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
890990d7
Commit
890990d7
authored
Aug 04, 2011
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More protection against overflow when advertising metrics.
parent
9767a7d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
message.c
message.c
+4
-3
No files found.
message.c
View file @
890990d7
...
...
@@ -937,9 +937,6 @@ flushupdates(struct network *net)
qsort
(
b
,
n
,
sizeof
(
struct
buffered_update
),
compare_buffered_updates
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
unsigned
short
seqno
;
unsigned
short
metric
;
/* The same update may be scheduled multiple times before it is
sent out. Since our buffer is now sorted, it is enough to
compare with the previous update. */
...
...
@@ -964,6 +961,9 @@ flushupdates(struct network *net)
unsigned
char
channels
[
DIVERSITY_HOPS
];
int
chlen
;
struct
network
*
route_net
=
route
->
neigh
->
network
;
int
metric
;
unsigned
short
seqno
;
seqno
=
route
->
seqno
;
metric
=
route_metric
(
route
);
if
(
metric
<
INFINITY
)
...
...
@@ -977,6 +977,7 @@ flushupdates(struct network *net)
(
int
)
route
->
refmetric
+
(
diversity_factor
*
route
->
cost
+
128
)
/
256
+
route
->
add_metric
;
metric
=
MIN
(
metric
,
INFINITY
);
metric
=
MAX
(
metric
,
route
->
refmetric
+
1
);
}
if
(
route_net
->
channel
==
NET_CHANNEL_NONINTERFERING
)
{
...
...
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