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
42d655e6
Commit
42d655e6
authored
Oct 19, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change calling sequence of update_feasible.
This avoids searching for the source again.
parent
edda7de4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
route.c
route.c
+3
-7
route.h
route.h
+1
-2
No files found.
route.c
View file @
42d655e6
...
...
@@ -228,17 +228,13 @@ change_route_metric(struct route *route, unsigned newmetric)
int
route_feasible
(
struct
route
*
route
)
{
return
update_feasible
(
route
->
src
->
id
,
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
seqno
,
route
->
refmetric
);
return
update_feasible
(
route
->
src
,
route
->
seqno
,
route
->
refmetric
);
}
int
update_feasible
(
const
unsigned
char
*
id
,
const
unsigned
char
*
p
,
unsigned
char
plen
,
update_feasible
(
struct
source
*
src
,
unsigned
short
seqno
,
unsigned
short
refmetric
)
{
struct
source
*
src
=
find_source
(
id
,
p
,
plen
,
0
,
0
);
if
(
src
==
NULL
)
return
1
;
...
...
@@ -359,7 +355,7 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
if
(
src
==
NULL
)
return
NULL
;
feasible
=
update_feasible
(
a
,
p
,
plen
,
seqno
,
refmetric
);
feasible
=
update_feasible
(
src
,
seqno
,
refmetric
);
route
=
find_route
(
p
,
plen
,
neigh
,
nexthop
);
metric
=
MIN
((
int
)
refmetric
+
neighbour_cost
(
neigh
)
+
add_metric
,
INFINITY
);
...
...
route.h
View file @
42d655e6
...
...
@@ -47,8 +47,7 @@ void uninstall_route(struct route *route);
void
switch_route
(
struct
route
*
old
,
struct
route
*
new
);
void
change_route_metric
(
struct
route
*
route
,
unsigned
newmetric
);
int
route_feasible
(
struct
route
*
route
);
int
update_feasible
(
const
unsigned
char
*
id
,
const
unsigned
char
*
p
,
unsigned
char
plen
,
int
update_feasible
(
struct
source
*
src
,
unsigned
short
seqno
,
unsigned
short
refmetric
);
struct
route
*
find_best_route
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
int
feasible
,
struct
neighbour
*
exclude
);
...
...
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