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
061d6822
Commit
061d6822
authored
Jun 20, 2014
by
Baptiste Jonglez
Committed by
Juliusz Chroboczek
Jun 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't directly modify a neighbour in parse_hello_subtlv()
parent
916fc9e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
message.c
message.c
+8
-4
No files found.
message.c
View file @
061d6822
...
...
@@ -167,7 +167,8 @@ parse_update_subtlv(const unsigned char *a, int alen,
}
static
int
parse_hello_subtlv
(
const
unsigned
char
*
a
,
int
alen
,
struct
neighbour
*
neigh
)
parse_hello_subtlv
(
const
unsigned
char
*
a
,
int
alen
,
unsigned
int
*
hello_send_us
)
{
int
type
,
len
,
i
=
0
,
ret
=
0
;
...
...
@@ -192,8 +193,7 @@ parse_hello_subtlv(const unsigned char *a, int alen, struct neighbour *neigh)
/* Nothing to do. */
}
else
if
(
type
==
SUBTLV_TIMESTAMP
)
{
if
(
len
>=
4
)
{
DO_NTOHL
(
neigh
->
hello_send_us
,
a
+
i
+
2
);
neigh
->
hello_rtt_receive_time
=
now
;
DO_NTOHL
(
*
hello_send_us
,
a
+
i
+
2
);
ret
=
1
;
}
else
{
fprintf
(
stderr
,
...
...
@@ -360,6 +360,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
}
else
if
(
type
==
MESSAGE_HELLO
)
{
unsigned
short
seqno
,
interval
;
int
changed
;
unsigned
int
timestamp
;
if
(
len
<
6
)
goto
fail
;
DO_NTOHS
(
seqno
,
message
+
4
);
DO_NTOHS
(
interval
,
message
+
6
);
...
...
@@ -373,8 +374,11 @@ parse_packet(const unsigned char *from, struct interface *ifp,
schedule_neighbours_check
(
interval
*
15
,
0
);
/* Sub-TLV handling. */
if
(
len
>
8
)
{
if
(
parse_hello_subtlv
(
message
+
8
,
len
-
6
,
neigh
)
>
0
)
if
(
parse_hello_subtlv
(
message
+
8
,
len
-
6
,
&
timestamp
)
>
0
)
{
neigh
->
hello_send_us
=
timestamp
;
neigh
->
hello_rtt_receive_time
=
now
;
have_hello_rtt
=
1
;
}
}
}
else
if
(
type
==
MESSAGE_IHU
)
{
unsigned
short
txcost
,
interval
;
...
...
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