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
Hide 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,
...
@@ -448,8 +448,9 @@ network_address(int ae, const unsigned char *a, unsigned int len,
}
}
static
struct
neighbour
*
static
struct
neighbour
*
preparse_packet
(
const
unsigned
char
*
body
,
int
bodylen
,
preparse_packet
(
const
unsigned
char
*
from
,
struct
interface
*
ifp
,
const
unsigned
char
*
address
,
struct
interface
*
ifp
)
const
unsigned
char
*
body
,
int
bodylen
,
const
unsigned
char
*
to
)
{
{
int
rc
,
i
;
int
rc
,
i
;
struct
neighbour
*
neigh
=
NULL
;
struct
neighbour
*
neigh
=
NULL
;
...
@@ -485,20 +486,24 @@ preparse_packet(const unsigned char *body, int bodylen,
...
@@ -485,20 +486,24 @@ preparse_packet(const unsigned char *body, int bodylen,
}
}
if
(
index
!=
NULL
)
if
(
index
!=
NULL
)
goto
done
;
goto
done
;
debugf
(
"Received PC from %s.
\n
"
,
format_address
(
address
));
debugf
(
"Received PC from %s.
\n
"
,
format_address
(
from
));
pc
=
message
+
2
;
pc
=
message
+
2
;
index
=
message
+
6
;
index
=
message
+
6
;
index_len
=
len
-
4
;
index_len
=
len
-
4
;
}
else
if
(
type
==
MESSAGE_CHALLENGE_REQUEST
)
{
}
else
if
(
type
==
MESSAGE_CHALLENGE_REQUEST
)
{
debugf
(
"Received challenge request from %s.
\n
"
,
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
=
message
+
2
;
nonce_len
=
len
;
nonce_len
=
len
;
}
else
if
(
type
==
MESSAGE_CHALLENGE_REPLY
)
{
}
else
if
(
type
==
MESSAGE_CHALLENGE_REPLY
)
{
debugf
(
"Received challenge reply from %s.
\n
"
,
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
)
if
(
neigh
==
NULL
)
goto
done
;
goto
done
;
...
@@ -531,7 +536,7 @@ preparse_packet(const unsigned char *body, int bodylen,
...
@@ -531,7 +536,7 @@ preparse_packet(const unsigned char *body, int bodylen,
if
(
neigh
==
NULL
||
!
neigh
->
have_index
||
neigh
->
index_len
!=
index_len
||
if
(
neigh
==
NULL
||
!
neigh
->
have_index
||
neigh
->
index_len
!=
index_len
||
memcmp
(
index
,
neigh
->
index
,
index_len
)
!=
0
)
{
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
)
if
(
neigh
==
NULL
)
return
NULL
;
return
NULL
;
rc
=
send_challenge_request
(
neigh
);
rc
=
send_challenge_request
(
neigh
);
...
@@ -550,7 +555,7 @@ preparse_packet(const unsigned char *body, int bodylen,
...
@@ -550,7 +555,7 @@ preparse_packet(const unsigned char *body, int bodylen,
maybe_send_challenge_reply:
maybe_send_challenge_reply:
if
(
nonce
!=
NULL
)
{
/* a challenge request was received */
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
)
if
(
neigh
==
NULL
)
return
NULL
;
return
NULL
;
send_challenge_reply
(
neigh
,
nonce
,
nonce_len
);
send_challenge_reply
(
neigh
,
nonce
,
nonce_len
);
...
@@ -618,7 +623,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -618,7 +623,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
fputs
(
"Received wrong hmac.
\n
"
,
stderr
);
fputs
(
"Received wrong hmac.
\n
"
,
stderr
);
return
;
return
;
case
1
:
case
1
:
neigh
=
preparse_packet
(
packet
,
bodylen
,
from
,
ifp
);
neigh
=
preparse_packet
(
from
,
ifp
,
packet
,
bodylen
,
to
);
if
(
neigh
==
NULL
)
{
if
(
neigh
==
NULL
)
{
fputs
(
"Received wrong PC or failed the challenge.
\n
"
,
stderr
);
fputs
(
"Received wrong PC or failed the challenge.
\n
"
,
stderr
);
return
;
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