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
140a4bfc
Commit
140a4bfc
authored
Mar 17, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change timeout strategy for IHUs.
parent
76ee5d38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
neighbour.c
neighbour.c
+24
-7
No files found.
neighbour.c
View file @
140a4bfc
...
...
@@ -214,6 +214,28 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
return
rc
;
}
static
int
reset_txcost
(
struct
neighbour
*
neigh
)
{
int
delay
;
delay
=
timeval_minus_msec
(
&
now
,
&
neigh
->
ihu_time
);
if
(
neigh
->
ihu_interval
>
0
&&
delay
<
neigh
->
ihu_interval
*
10
*
3
)
return
0
;
/* If we're losing a lot of packets, we probably lost an IHU too */
if
(
delay
>=
180000
||
(
neigh
->
reach
&
0xFFF0
)
==
0
||
(
neigh
->
ihu_interval
>
0
&&
delay
>=
neigh
->
ihu_interval
*
10
*
10
))
{
neigh
->
txcost
=
INFINITY
;
neigh
->
ihu_time
=
now
;
return
1
;
}
return
0
;
}
int
check_neighbours
()
{
...
...
@@ -236,13 +258,7 @@ check_neighbours()
delay
=
timeval_minus_msec
(
&
now
,
&
neighs
[
i
].
ihu_time
);
if
(
delay
>=
180000
||
(
neighs
[
i
].
ihu_interval
>
0
&&
delay
>=
neighs
[
i
].
ihu_interval
*
10
*
4
))
{
neighs
[
i
].
txcost
=
INFINITY
;
neighs
[
i
].
ihu_time
=
now
;
changed
=
1
;
}
changed
=
changed
||
reset_txcost
(
&
neighs
[
i
]);
if
(
changed
)
update_neighbour_metric
(
&
neighs
[
i
]);
...
...
@@ -296,6 +312,7 @@ neighbour_cost(struct neighbour *neigh)
if
(
!
neigh
->
network
->
up
)
return
INFINITY
;
reset_txcost
(
neigh
);
a
=
neigh
->
txcost
;
if
(
a
>=
INFINITY
)
...
...
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