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
ac2cf59d
Commit
ac2cf59d
authored
Feb 02, 2011
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't send UNKNOWN or NONINTERFERING channel values.
parent
e45908c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
message.c
message.c
+12
-2
network.h
network.h
+5
-4
No files found.
message.c
View file @
ac2cf59d
...
@@ -970,8 +970,18 @@ flushupdates(struct network *net)
...
@@ -970,8 +970,18 @@ flushupdates(struct network *net)
(
diversity_factor
*
route
->
cost
/
+
128
)
/
256
+
(
diversity_factor
*
route
->
cost
/
+
128
)
/
256
+
route
->
add_metric
;
route
->
add_metric
;
}
}
if
(
net
->
channel
==
NET_CHANNEL_NONINTERFERING
)
{
memcpy
(
channels
,
route
->
channels
,
DIVERSITY_HOPS
);
}
else
{
if
(
net
->
channel
==
NET_CHANNEL_UNKNOWN
)
channels
[
0
]
=
NET_CHANNEL_INTERFERING
;
else
{
assert
(
net
->
channel
>
0
&&
net
->
channel
<
254
);
channels
[
0
]
=
net
->
channel
;
channels
[
0
]
=
net
->
channel
;
}
memcpy
(
channels
+
1
,
route
->
channels
,
DIVERSITY_HOPS
-
1
);
memcpy
(
channels
+
1
,
route
->
channels
,
DIVERSITY_HOPS
-
1
);
}
channels_len
=
strnlen
((
char
*
)
channels
,
DIVERSITY_HOPS
);
channels_len
=
strnlen
((
char
*
)
channels
,
DIVERSITY_HOPS
);
really_send_update
(
net
,
route
->
src
->
id
,
really_send_update
(
net
,
route
->
src
->
id
,
route
->
src
->
prefix
,
route
->
src
->
prefix
,
...
...
network.h
View file @
ac2cf59d
...
@@ -50,9 +50,10 @@ struct network_conf {
...
@@ -50,9 +50,10 @@ struct network_conf {
#define NET_LQ (1 << 3)
#define NET_LQ (1 << 3)
#define NET_FARAWAY (1 << 4)
#define NET_FARAWAY (1 << 4)
#define NET_CHANNEL_UNKNOWN 0
/* Only INTERFERING can appear on the wire. */
#define NET_CHANNEL_INTERFERING 253
#define NET_CHANNEL_UNKNOWN -1
#define NET_CHANNEL_NONINTERFERING 254
#define NET_CHANNEL_INTERFERING 254
#define NET_CHANNEL_NONINTERFERING -2
struct
network
{
struct
network
{
struct
network
*
next
;
struct
network
*
next
;
...
@@ -60,7 +61,7 @@ struct network {
...
@@ -60,7 +61,7 @@ struct network {
unsigned
int
ifindex
;
unsigned
int
ifindex
;
unsigned
short
flags
;
unsigned
short
flags
;
unsigned
short
cost
;
unsigned
short
cost
;
unsigned
char
channel
;
int
channel
;
struct
timeval
hello_timeout
;
struct
timeval
hello_timeout
;
struct
timeval
update_timeout
;
struct
timeval
update_timeout
;
struct
timeval
flush_timeout
;
struct
timeval
flush_timeout
;
...
...
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