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
a58731a9
Commit
a58731a9
authored
Apr 20, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify and correct update_feasible.
parent
70066514
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
16 deletions
+9
-16
route.c
route.c
+7
-14
route.h
route.h
+2
-2
No files found.
route.c
View file @
a58731a9
...
...
@@ -228,19 +228,11 @@ route_feasible(struct route *route)
}
int
update_feasible
(
unsigned
char
seqno
,
unsigned
short
metric
,
struct
destination
*
dest
,
struct
route
*
route
)
update_feasible
(
unsigned
char
seqno
,
unsigned
short
ref
metric
,
struct
destination
*
dest
)
{
if
(
route
)
{
/* This allows us to keep unfeasible routes around in order to
keep statistics about their stability. */
if
(
seqno_compare
(
route
->
seqno
,
seqno
)
<
0
||
(
route
->
seqno
==
seqno
&&
metric
<=
route
->
refmetric
))
return
1
;
}
if
(
seqno_compare
(
dest
->
seqno
,
seqno
)
<
0
||
(
dest
->
seqno
==
seqno
&&
metric
<
dest
->
metric
))
(
dest
->
seqno
==
seqno
&&
ref
metric
<
dest
->
metric
))
return
1
;
return
0
;
...
...
@@ -340,10 +332,11 @@ update_route(const unsigned char *d, int seqno, int refmetric,
route
=
find_route
(
d
,
nexthop
);
if
(
!
update_feasible
(
seqno
,
metric
,
dest
,
route
))
if
(
!
update_feasible
(
seqno
,
refmetric
,
dest
))
{
debugf
(
"Rejecting unfeasible update from %s.
\n
"
,
format_address
(
nexthop
->
address
));
return
NULL
;
else
debugf
(
"Rejecting unfeasible update.
\n
"
);
}
if
(
route
)
{
int
oldseqno
;
...
...
route.h
View file @
a58731a9
...
...
@@ -45,8 +45,8 @@ unsigned int metric_to_kernel(int metric);
void
install_route
(
struct
route
*
route
);
void
uninstall_route
(
struct
route
*
route
);
int
route_feasible
(
struct
route
*
route
);
int
update_feasible
(
unsigned
char
seqno
,
unsigned
short
metric
,
struct
destination
*
dest
,
struct
route
*
route
);
int
update_feasible
(
unsigned
char
seqno
,
unsigned
short
ref
metric
,
struct
destination
*
dest
);
struct
route
*
find_best_route
(
struct
destination
*
dest
);
void
update_neighbour_metric
(
struct
neighbour
*
neigh
);
void
update_route_metric
(
struct
route
*
route
);
...
...
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