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
8afa62b4
Commit
8afa62b4
authored
Jun 04, 2010
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have change_route_metric take refmetrics too.
parent
f3378dab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
route.c
route.c
+8
-10
No files found.
route.c
View file @
8afa62b4
...
...
@@ -237,13 +237,11 @@ switch_routes(struct route *old, struct route *new)
}
static
void
change_route_metric
(
struct
route
*
route
,
unsigned
cost
,
unsigned
add
)
change_route_metric
(
struct
route
*
route
,
unsigned
refmetric
,
unsigned
cost
,
unsigned
add
)
{
int
old
,
new
;
int
newmetric
=
MIN
(
route
->
refmetric
+
cost
+
add
,
INFINITY
);
if
(
route_metric
(
route
)
==
newmetric
)
return
;
int
newmetric
=
MIN
(
refmetric
+
cost
+
add
,
INFINITY
);
old
=
metric_to_kernel
(
route_metric
(
route
));
new
=
metric_to_kernel
(
newmetric
);
...
...
@@ -261,6 +259,7 @@ change_route_metric(struct route *route, unsigned cost, unsigned add)
}
}
route
->
refmetric
=
refmetric
;
route
->
cost
=
cost
;
route
->
add_metric
=
add
;
local_notify_route
(
route
,
LOCAL_CHANGE
);
...
...
@@ -269,8 +268,7 @@ change_route_metric(struct route *route, unsigned cost, unsigned add)
static
void
retract_route
(
struct
route
*
route
)
{
route
->
refmetric
=
INFINITY
;
change_route_metric
(
route
,
INFINITY
,
0
);
change_route_metric
(
route
,
INFINITY
,
INFINITY
,
0
);
}
int
...
...
@@ -375,7 +373,7 @@ update_route_metric(struct route *route)
route
->
src
->
prefix
,
route
->
src
->
plen
,
neigh
->
address
,
neigh
->
network
->
ifindex
);
change_route_metric
(
route
,
change_route_metric
(
route
,
route
->
refmetric
,
neighbour_cost
(
route
->
neigh
),
add_metric
);
if
(
route_metric
(
route
)
!=
oldmetric
)
route_changed
(
route
,
route
->
src
,
oldmetric
);
...
...
@@ -471,8 +469,8 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
if
(
feasible
&&
refmetric
<
INFINITY
)
route
->
time
=
now
.
tv_sec
;
route
->
seqno
=
seqno
;
route
->
refmetric
=
refmetric
;
change_route_metric
(
route
,
neighbour_cost
(
neigh
),
add_metric
);
change_route_metric
(
route
,
refmetric
,
neighbour_cost
(
neigh
),
add_metric
);
route
->
hold_time
=
hold_time
;
route_changed
(
route
,
oldsrc
,
oldmetric
);
...
...
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