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
7de67155
Commit
7de67155
authored
Jun 28, 2019
by
Etienne MARAIS
Committed by
Juliusz Chroboczek
May 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create neighbour after checking HMAC.
parent
ecd1f428
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
message.c
message.c
+16
-8
No files found.
message.c
View file @
7de67155
...
...
@@ -546,7 +546,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
const
unsigned
char
*
message
;
unsigned
char
type
,
len
;
int
bodylen
;
struct
neighbour
*
neigh
;
struct
neighbour
*
neigh
=
NULL
;
int
have_router_id
=
0
,
have_v4_prefix
=
0
,
have_v6_prefix
=
0
,
have_v4_nh
=
0
,
have_v6_nh
=
0
;
unsigned
char
router_id
[
8
],
v4_prefix
[
16
],
v6_prefix
[
16
],
...
...
@@ -587,24 +587,32 @@ parse_packet(const unsigned char *from, struct interface *ifp,
bodylen
=
packetlen
-
4
;
}
neigh
=
find_neighbour
(
from
,
ifp
);
if
(
neigh
==
NULL
)
{
fprintf
(
stderr
,
"Couldn't allocate neighbour.
\n
"
);
return
;
}
if
(
ifp
->
key
!=
NULL
&&
!
(
ifp
->
flags
&
IF_NO_HMAC_VERIFY
))
{
if
(
check_hmac
(
packet
,
packetlen
,
bodylen
,
neigh
->
address
,
to
)
!=
1
)
{
if
(
check_hmac
(
packet
,
packetlen
,
bodylen
,
from
,
to
)
!=
1
)
{
fprintf
(
stderr
,
"Received wrong hmac.
\n
"
);
return
;
}
neigh
=
find_neighbour
(
from
,
ifp
);
if
(
neigh
==
NULL
)
{
fprintf
(
stderr
,
"Couldn't allocate neighbour.
\n
"
);
return
;
}
if
(
preparse_packet
(
packet
,
bodylen
,
neigh
,
ifp
)
==
0
)
{
fprintf
(
stderr
,
"Received wrong PC or failed the challenge.
\n
"
);
return
;
}
}
if
(
neigh
==
NULL
)
{
neigh
=
find_neighbour
(
from
,
ifp
);
if
(
neigh
==
NULL
)
{
fprintf
(
stderr
,
"Couldn't allocate neighbour.
\n
"
);
return
;
}
}
i
=
0
;
while
(
i
<
bodylen
)
{
message
=
packet
+
4
+
i
;
...
...
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