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
13f0c503
Commit
13f0c503
authored
Jul 20, 2017
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use unicast Hellos for reachability on wired links.
parent
643c839c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
neighbour.c
neighbour.c
+20
-8
No files found.
neighbour.c
View file @
13f0c503
...
@@ -256,15 +256,32 @@ check_neighbours()
...
@@ -256,15 +256,32 @@ check_neighbours()
return
msecs
;
return
msecs
;
}
}
/* To lose one hello is a misfortune, to lose two is carelessness. */
static
int
two_three
(
int
reach
)
{
if
((
reach
&
0xC000
)
==
0xC000
)
return
1
;
else
if
((
reach
&
0xC000
)
==
0
)
return
0
;
else
if
((
reach
&
0x2000
))
return
1
;
else
return
0
;
}
unsigned
unsigned
neighbour_rxcost
(
struct
neighbour
*
neigh
)
neighbour_rxcost
(
struct
neighbour
*
neigh
)
{
{
unsigned
delay
;
unsigned
delay
,
udelay
;
unsigned
short
reach
=
neigh
->
hello
.
reach
;
unsigned
short
reach
=
neigh
->
hello
.
reach
;
unsigned
short
ureach
=
neigh
->
uhello
.
reach
;
delay
=
timeval_minus_msec
(
&
now
,
&
neigh
->
hello
.
time
);
delay
=
timeval_minus_msec
(
&
now
,
&
neigh
->
hello
.
time
);
udelay
=
timeval_minus_msec
(
&
now
,
&
neigh
->
uhello
.
time
);
if
((
reach
&
0xFFF0
)
==
0
||
delay
>=
180000
)
{
if
(((
reach
&
0xFFF0
)
==
0
||
delay
>=
180000
)
&&
((
ureach
&
0xFFF0
)
==
0
||
udelay
>=
180000
))
{
return
INFINITY
;
return
INFINITY
;
}
else
if
((
neigh
->
ifp
->
flags
&
IF_LQ
))
{
}
else
if
((
neigh
->
ifp
->
flags
&
IF_LQ
))
{
int
sreach
=
int
sreach
=
...
@@ -278,12 +295,7 @@ neighbour_rxcost(struct neighbour *neigh)
...
@@ -278,12 +295,7 @@ neighbour_rxcost(struct neighbour *neigh)
cost
=
(
cost
*
(
delay
-
20000
)
+
10000
)
/
20000
;
cost
=
(
cost
*
(
delay
-
20000
)
+
10000
)
/
20000
;
return
MIN
(
cost
,
INFINITY
);
return
MIN
(
cost
,
INFINITY
);
}
else
{
}
else
{
/* To lose one hello is a misfortune, to lose two is carelessness. */
if
(
two_three
(
reach
)
||
two_three
(
ureach
))
if
((
reach
&
0xC000
)
==
0xC000
)
return
neigh
->
ifp
->
cost
;
else
if
((
reach
&
0xC000
)
==
0
)
return
INFINITY
;
else
if
((
reach
&
0x2000
))
return
neigh
->
ifp
->
cost
;
return
neigh
->
ifp
->
cost
;
else
else
return
INFINITY
;
return
INFINITY
;
...
...
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