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
6a3bd794
Commit
6a3bd794
authored
Apr 08, 2009
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement hello-interval configuration option.
parent
90616166
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
config.c
config.c
+6
-0
network.c
network.c
+12
-14
network.h
network.h
+1
-0
No files found.
config.c
View file @
6a3bd794
...
...
@@ -363,6 +363,12 @@ parse_nconf(gnc_t gnc, void *closure)
if
(
c
<
-
1
||
cost
<=
0
||
cost
>
0xFFFF
)
goto
error
;
nconf
->
cost
=
cost
;
}
else
if
(
strcmp
(
token
,
"hello-interval"
)
==
0
)
{
int
interval
;
c
=
getint
(
c
,
&
interval
,
gnc
,
closure
);
if
(
c
<
-
1
||
interval
<=
0
||
interval
>
0xFFFF
)
goto
error
;
nconf
->
hello_interval
=
interval
;
}
else
{
goto
error
;
}
...
...
network.c
View file @
6a3bd794
...
...
@@ -99,23 +99,21 @@ int
update_hello_interval
(
struct
network
*
net
)
{
int
rc
=
0
;
unsigned
short
interval
;
if
(
network_idle
(
net
))
interval
=
idle_hello_interval
;
else
if
(
NET_CONF
(
net
,
hello_interval
,
0
)
>
0
)
interval
=
NET_CONF
(
net
,
hello_interval
,
0
);
else
if
((
net
->
flags
&
NET_WIRED
))
interval
=
wired_hello_interval
;
else
interval
=
wireless_hello_interval
;
if
(
network_idle
(
net
))
{
if
(
net
->
hello_interval
!=
idle_hello_interval
)
{
net
->
hello_interval
=
idle_hello_interval
;
rc
=
1
;
}
}
else
if
((
net
->
flags
&
NET_WIRED
))
{
if
(
net
->
hello_interval
!=
wired_hello_interval
)
{
net
->
hello_interval
=
wired_hello_interval
;
if
(
net
->
hello_interval
!=
interval
)
{
net
->
hello_interval
=
interval
;
rc
=
1
;
}
}
else
{
if
(
net
->
hello_interval
!=
wireless_hello_interval
)
{
net
->
hello_interval
=
wireless_hello_interval
;
rc
=
1
;
}
}
net
->
self_update_interval
=
MAX
(
update_interval
/
2
,
net
->
hello_interval
);
...
...
network.h
View file @
6a3bd794
...
...
@@ -30,6 +30,7 @@ struct buffered_update {
struct
network_conf
{
char
*
ifname
;
unsigned
short
cost
;
unsigned
short
hello_interval
;
struct
network_conf
*
next
;
};
...
...
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