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
ca5d3eaa
Commit
ca5d3eaa
authored
Mar 17, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename check_neighbours_time, make it external.
parent
776ff0af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
babel.c
babel.c
+7
-6
No files found.
babel.c
View file @
ca5d3eaa
...
...
@@ -86,6 +86,8 @@ static int kernel_routes_changed = 0;
static
int
kernel_link_changed
=
0
;
static
int
kernel_addr_changed
=
0
;
struct
timeval
check_neighbours_timeout
;
static
volatile
sig_atomic_t
exiting
=
0
,
dumping
=
0
,
changed
=
0
;
static
int
kernel_routes_callback
(
int
changed
,
void
*
closure
);
...
...
@@ -98,7 +100,6 @@ main(int argc, char **argv)
{
struct
sockaddr_in6
sin6
;
int
i
,
rc
,
fd
,
rfd
,
have_id
=
0
;
struct
timeval
check_neighbours_time
;
time_t
expiry_time
,
source_expiry_time
,
kernel_dump_time
;
char
*
config_file
=
NULL
;
void
*
vrc
;
...
...
@@ -511,7 +512,7 @@ main(int argc, char **argv)
kernel_link_changed
=
0
;
kernel_addr_changed
=
0
;
kernel_dump_time
=
now
.
tv_sec
+
20
+
random
()
%
20
;
timeval_plus_msec
(
&
check_neighbours_time
,
&
now
,
5000
+
random
()
%
5000
);
timeval_plus_msec
(
&
check_neighbours_time
out
,
&
now
,
5000
+
random
()
%
5000
);
expiry_time
=
now
.
tv_sec
+
20
+
random
()
%
20
;
source_expiry_time
=
now
.
tv_sec
+
200
+
random
()
%
200
;
...
...
@@ -537,7 +538,7 @@ main(int argc, char **argv)
gettimeofday
(
&
now
,
NULL
);
tv
=
check_neighbours_time
;
tv
=
check_neighbours_time
out
;
timeval_min_sec
(
&
tv
,
expiry_time
);
timeval_min_sec
(
&
tv
,
source_expiry_time
);
timeval_min_sec
(
&
tv
,
kernel_dump_time
);
...
...
@@ -609,7 +610,7 @@ main(int argc, char **argv)
if
(
changed
)
{
kernel_dump_time
=
now
.
tv_sec
;
check_neighbours_time
=
now
;
check_neighbours_time
out
=
now
;
expiry_time
=
now
.
tv_sec
;
rc
=
reopen_logfile
();
if
(
rc
<
0
)
{
...
...
@@ -636,11 +637,11 @@ main(int argc, char **argv)
kernel_dump_time
=
now
.
tv_sec
+
20
+
random
()
%
20
;
}
if
(
timeval_compare
(
&
check_neighbours_time
,
&
now
)
<
0
)
{
if
(
timeval_compare
(
&
check_neighbours_time
out
,
&
now
)
<
0
)
{
int
msecs
;
msecs
=
check_neighbours
();
msecs
=
MAX
(
msecs
,
500
);
timeval_plus_msec
(
&
check_neighbours_time
,
&
now
,
timeval_plus_msec
(
&
check_neighbours_time
out
,
&
now
,
msecs
/
2
+
random
()
%
msecs
);
}
...
...
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