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
68120830
Commit
68120830
authored
Jun 17, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure all seqno arithmetic is modulo 256.
parent
5c68b982
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
message.c
message.c
+12
-3
route.c
route.c
+1
-1
No files found.
message.c
View file @
68120830
...
...
@@ -124,6 +124,14 @@ parse_packet(const unsigned char *from, struct network *net,
format_address
(
from
),
format_address
(
message
+
4
));
if
(
memcmp
(
message
+
4
,
myid
,
16
)
==
0
)
{
int
metric
=
((
message
[
2
]
<<
8
)
|
(
message
[
3
]
&
0xFF
));
int
theirseqno
=
message
[
1
];
if
(
metric
>=
INFINITY
)
{
/* Oh my, someone is retracting a route to me. */
send_txcost
(
neigh
,
NULL
);
send_self_update
(
neigh
->
network
,
seqno_compare
(
theirseqno
,
seqno
)
<
0
);
}
continue
;
}
...
...
@@ -270,7 +278,8 @@ send_hello(struct network *net)
debugf
(
"Sending hello to %s.
\n
"
,
net
->
ifname
);
start_message
(
net
,
20
);
accumulate_byte
(
net
,
0
);
accumulate_byte
(
net
,
net
->
hello_seqno
++
);
net
->
hello_seqno
=
((
net
->
hello_seqno
+
1
)
&
0xFF
);
accumulate_byte
(
net
,
net
->
hello_seqno
);
accumulate_short
(
net
,
net
->
hello_interval
);
accumulate_data
(
net
,
myid
,
16
);
schedule_flush
(
net
);
...
...
@@ -514,7 +523,7 @@ void
send_self_update
(
struct
network
*
net
,
int
force_seqno
)
{
if
(
force_seqno
||
seqno_time
+
seqno_interval
<
now
.
tv_sec
)
{
seqno
++
;
seqno
=
((
seqno
+
1
)
&
0xFF
)
;
seqno_time
=
now
.
tv_sec
;
}
...
...
@@ -544,7 +553,7 @@ send_self_retract(struct network *net)
debugf
(
"Retracting self on %s.
\n
"
,
net
->
ifname
);
seqno
++
;
seqno
=
((
seqno
+
1
)
&
0xFF
)
;
seqno_time
=
now
.
tv_sec
;
start_message
(
net
,
20
);
...
...
route.c
View file @
68120830
...
...
@@ -101,7 +101,7 @@ flush_route(struct route *route)
send_triggered_update
(
new_route
,
oldmetric
);
}
else
{
if
(
destination
->
metric
<
INFINITY
)
{
destination
->
seqno
++
;
destination
->
seqno
=
((
destination
->
seqno
+
1
)
&
0xFF
)
;
destination
->
metric
=
INFINITY
;
}
send_update
(
route
->
dest
,
NULL
);
...
...
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