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
cee445be
Commit
cee445be
authored
Apr 11, 2013
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the interface to schedule_neighbours_check less confusing.
parent
854aa4ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
babeld.c
babeld.c
+3
-3
message.c
message.c
+4
-2
No files found.
babeld.c
View file @
cee445be
...
...
@@ -674,7 +674,8 @@ main(int argc, char **argv)
if
(
timeval_compare
(
&
check_neighbours_timeout
,
&
now
)
<
0
)
{
int
msecs
;
msecs
=
check_neighbours
();
msecs
=
MAX
(
msecs
,
10
);
/* Multiply by 3/2 to allow neighbours to expire. */
msecs
=
MAX
(
3
*
msecs
/
2
,
10
);
schedule_neighbours_check
(
msecs
,
1
);
}
...
...
@@ -818,13 +819,12 @@ main(int argc, char **argv)
exit
(
1
);
}
/* Schedule a neighbours check after roughly 3/2 times msecs have elapsed. */
void
schedule_neighbours_check
(
int
msecs
,
int
override
)
{
struct
timeval
timeout
;
timeval_add_msec
(
&
timeout
,
&
now
,
roughly
(
msecs
*
3
/
2
));
timeval_add_msec
(
&
timeout
,
&
now
,
roughly
(
msecs
));
if
(
override
)
check_neighbours_timeout
=
timeout
;
else
...
...
message.c
View file @
cee445be
...
...
@@ -274,7 +274,8 @@ parse_packet(const unsigned char *from, struct interface *ifp,
changed
=
update_neighbour
(
neigh
,
seqno
,
interval
);
update_neighbour_metric
(
neigh
,
changed
);
if
(
interval
>
0
)
schedule_neighbours_check
(
interval
*
10
,
0
);
/* Multiply by 3/2 to allow hellos to expire. */
schedule_neighbours_check
(
interval
*
15
,
0
);
}
else
if
(
type
==
MESSAGE_IHU
)
{
unsigned
short
txcost
,
interval
;
unsigned
char
address
[
16
];
...
...
@@ -295,7 +296,8 @@ parse_packet(const unsigned char *from, struct interface *ifp,
neigh
->
ihu_interval
=
interval
;
update_neighbour_metric
(
neigh
,
changed
);
if
(
interval
>
0
)
schedule_neighbours_check
(
interval
*
10
*
3
,
0
);
/* Multiply by 3/2 to allow neighbours to expire. */
schedule_neighbours_check
(
interval
*
45
,
0
);
}
}
else
if
(
type
==
MESSAGE_ROUTER_ID
)
{
if
(
len
<
10
)
{
...
...
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