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
5255a5fd
Commit
5255a5fd
authored
Mar 16, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid sending multiple hellos in a single packet.
parent
ad9b1542
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
message.c
message.c
+20
-0
No files found.
message.c
View file @
5255a5fd
...
@@ -444,11 +444,31 @@ send_message(struct network *net,
...
@@ -444,11 +444,31 @@ send_message(struct network *net,
schedule_flush
(
net
);
schedule_flush
(
net
);
}
}
/* Flush buffers if they contain any hellos. This avoids sending multiple
hellos in a single packet, which breaks link quality estimation. */
int
flush_hellos
(
struct
network
*
net
)
{
int
i
;
assert
(
net
->
buffered
%
24
==
0
);
for
(
i
=
0
;
i
<
net
->
buffered
/
25
;
i
++
)
{
const
unsigned
char
*
message
;
message
=
(
const
unsigned
char
*
)(
net
->
sendbuf
+
i
*
24
);
if
(
message
[
0
]
==
0
)
{
flushbuf
(
net
);
return
1
;
}
}
return
0
;
}
void
void
send_hello_noupdate
(
struct
network
*
net
,
unsigned
interval
)
send_hello_noupdate
(
struct
network
*
net
,
unsigned
interval
)
{
{
debugf
(
"Sending hello (%d) to %s.
\n
"
,
interval
,
net
->
ifname
);
debugf
(
"Sending hello (%d) to %s.
\n
"
,
interval
,
net
->
ifname
);
net
->
hello_seqno
=
seqno_plus
(
net
->
hello_seqno
,
1
);
net
->
hello_seqno
=
seqno_plus
(
net
->
hello_seqno
,
1
);
flush_hellos
(
net
);
delay_jitter
(
&
net
->
hello_time
,
&
net
->
hello_timeout
,
delay_jitter
(
&
net
->
hello_time
,
&
net
->
hello_timeout
,
net
->
hello_interval
);
net
->
hello_interval
);
send_message
(
net
,
0
,
0
,
0
,
net
->
hello_seqno
,
send_message
(
net
,
0
,
0
,
0
,
net
->
hello_seqno
,
...
...
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