Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
d66a4d2b
Commit
d66a4d2b
authored
Aug 19, 2020
by
Antonin Décimo
Committed by
Juliusz Chroboczek
May 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore a Challenge Request received on multicast.
parent
024c17ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
message.c
message.c
+14
-9
No files found.
message.c
View file @
d66a4d2b
...
...
@@ -448,8 +448,9 @@ network_address(int ae, const unsigned char *a, unsigned int len,
}
static
struct
neighbour
*
preparse_packet
(
const
unsigned
char
*
body
,
int
bodylen
,
const
unsigned
char
*
address
,
struct
interface
*
ifp
)
preparse_packet
(
const
unsigned
char
*
from
,
struct
interface
*
ifp
,
const
unsigned
char
*
body
,
int
bodylen
,
const
unsigned
char
*
to
)
{
int
rc
,
i
;
struct
neighbour
*
neigh
=
NULL
;
...
...
@@ -485,20 +486,24 @@ preparse_packet(const unsigned char *body, int bodylen,
}
if
(
index
!=
NULL
)
goto
done
;
debugf
(
"Received PC from %s.
\n
"
,
format_address
(
address
));
debugf
(
"Received PC from %s.
\n
"
,
format_address
(
from
));
pc
=
message
+
2
;
index
=
message
+
6
;
index_len
=
len
-
4
;
}
else
if
(
type
==
MESSAGE_CHALLENGE_REQUEST
)
{
debugf
(
"Received challenge request from %s.
\n
"
,
format_address
(
address
));
format_address
(
from
));
if
(
IN6_IS_ADDR_MULTICAST
(
to
))
goto
done
;
nonce
=
message
+
2
;
nonce_len
=
len
;
}
else
if
(
type
==
MESSAGE_CHALLENGE_REPLY
)
{
debugf
(
"Received challenge reply from %s.
\n
"
,
format_address
(
address
));
format_address
(
from
));
neigh
=
neigh
!=
NULL
?
neigh
:
find_neighbour
(
address
,
ifp
);
neigh
=
neigh
!=
NULL
?
neigh
:
find_neighbour
(
from
,
ifp
);
if
(
neigh
==
NULL
)
goto
done
;
...
...
@@ -531,7 +536,7 @@ preparse_packet(const unsigned char *body, int bodylen,
if
(
neigh
==
NULL
||
!
neigh
->
have_index
||
neigh
->
index_len
!=
index_len
||
memcmp
(
index
,
neigh
->
index
,
index_len
)
!=
0
)
{
neigh
=
neigh
!=
NULL
?
neigh
:
find_neighbour
(
address
,
ifp
);
neigh
=
neigh
!=
NULL
?
neigh
:
find_neighbour
(
from
,
ifp
);
if
(
neigh
==
NULL
)
return
NULL
;
rc
=
send_challenge_request
(
neigh
);
...
...
@@ -550,7 +555,7 @@ preparse_packet(const unsigned char *body, int bodylen,
maybe_send_challenge_reply:
if
(
nonce
!=
NULL
)
{
/* a challenge request was received */
neigh
=
neigh
!=
NULL
?
neigh
:
find_neighbour
(
address
,
ifp
);
neigh
=
neigh
!=
NULL
?
neigh
:
find_neighbour
(
from
,
ifp
);
if
(
neigh
==
NULL
)
return
NULL
;
send_challenge_reply
(
neigh
,
nonce
,
nonce_len
);
...
...
@@ -618,7 +623,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
fputs
(
"Received wrong hmac.
\n
"
,
stderr
);
return
;
case
1
:
neigh
=
preparse_packet
(
packet
,
bodylen
,
from
,
ifp
);
neigh
=
preparse_packet
(
from
,
ifp
,
packet
,
bodylen
,
to
);
if
(
neigh
==
NULL
)
{
fputs
(
"Received wrong PC or failed the challenge.
\n
"
,
stderr
);
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment