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
51e4a64e
Commit
51e4a64e
authored
Nov 02, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify jitter computation.
Remove tracking of time, only timeouts remain.
parent
889a9d83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
22 deletions
+8
-22
message.c
message.c
+3
-10
network.c
network.c
+4
-8
network.h
network.h
+1
-4
No files found.
message.c
View file @
51e4a64e
...
...
@@ -636,8 +636,7 @@ send_hello_noupdate(struct network *net, unsigned interval)
flushbuf
(
net
);
net
->
hello_seqno
=
seqno_plus
(
net
->
hello_seqno
,
1
);
delay_jitter
(
&
net
->
hello_time
,
&
net
->
hello_timeout
,
net
->
hello_interval
);
delay_jitter
(
&
net
->
hello_timeout
,
net
->
hello_interval
);
if
(
!
net
->
up
)
return
;
...
...
@@ -1006,10 +1005,6 @@ send_update(struct network *net, int urgent,
}
}
else
{
send_self_update
(
net
,
0
);
/* Don't send full route dumps more than ten times per second */
if
(
net
->
update_time
.
tv_sec
>
0
&&
timeval_minus_msec
(
&
now
,
&
net
->
update_time
)
<
100
)
return
;
if
(
!
selfonly
&&
!
network_idle
(
net
))
{
debugf
(
"Sending update to %s for any.
\n
"
,
net
->
ifname
);
for
(
i
=
0
;
i
<
numroutes
;
i
++
)
...
...
@@ -1017,8 +1012,7 @@ send_update(struct network *net, int urgent,
buffer_update
(
net
,
routes
[
i
].
src
->
prefix
,
routes
[
i
].
src
->
plen
);
}
delay_jitter
(
&
net
->
update_time
,
&
net
->
update_timeout
,
update_interval
);
delay_jitter
(
&
net
->
update_timeout
,
update_interval
);
}
schedule_update_flush
(
net
,
urgent
);
}
...
...
@@ -1097,8 +1091,7 @@ send_self_update(struct network *net, int force_seqno)
for
(
i
=
0
;
i
<
numxroutes
;
i
++
)
send_update
(
net
,
0
,
xroutes
[
i
].
prefix
,
xroutes
[
i
].
plen
);
}
delay_jitter
(
&
net
->
self_update_time
,
&
net
->
self_update_timeout
,
net
->
self_update_interval
);
delay_jitter
(
&
net
->
self_update_timeout
,
net
->
self_update_interval
);
}
void
...
...
network.c
View file @
51e4a64e
...
...
@@ -137,9 +137,8 @@ update_jitter(struct network *net, int urgent)
}
void
delay_jitter
(
struct
timeval
*
time
,
struct
timeval
*
time
out
,
int
msecs
)
delay_jitter
(
struct
timeval
*
timeout
,
int
msecs
)
{
*
time
=
now
;
timeval_plus_msec
(
timeout
,
&
now
,
roughly
(
msecs
));
}
...
...
@@ -280,12 +279,9 @@ network_up(struct network *net, int up)
memcpy
(
net
->
ll
,
ll
,
rc
*
16
);
}
}
delay_jitter
(
&
net
->
hello_time
,
&
net
->
hello_timeout
,
net
->
hello_interval
);
delay_jitter
(
&
net
->
self_update_time
,
&
net
->
self_update_timeout
,
net
->
self_update_interval
);
delay_jitter
(
&
net
->
update_time
,
&
net
->
update_timeout
,
update_interval
);
delay_jitter
(
&
net
->
hello_timeout
,
net
->
hello_interval
);
delay_jitter
(
&
net
->
self_update_timeout
,
net
->
self_update_interval
);
delay_jitter
(
&
net
->
update_timeout
,
update_interval
);
send_hello
(
net
);
send_request
(
net
,
NULL
,
0
);
}
else
{
...
...
network.h
View file @
51e4a64e
...
...
@@ -33,11 +33,8 @@ struct network {
char
wired
;
unsigned
int
ifindex
;
unsigned
short
cost
;
struct
timeval
hello_time
;
struct
timeval
hello_timeout
;
struct
timeval
self_update_time
;
struct
timeval
self_update_timeout
;
struct
timeval
update_time
;
struct
timeval
update_timeout
;
char
ifname
[
IF_NAMESIZE
];
unsigned
char
*
ipv4
;
...
...
@@ -75,7 +72,7 @@ int network_idle(struct network *net);
int
update_hello_interval
(
struct
network
*
net
);
unsigned
jitter
(
struct
network
*
net
,
int
urgent
);
unsigned
update_jitter
(
struct
network
*
net
,
int
urgent
);
void
delay_jitter
(
struct
timeval
*
time
,
struct
timeval
*
time
out
,
int
msecs
);
void
delay_jitter
(
struct
timeval
*
timeout
,
int
msecs
);
int
network_up
(
struct
network
*
net
,
int
up
);
int
network_ll_address
(
struct
network
*
net
,
const
unsigned
char
*
address
);
void
check_networks
(
void
);
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