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
6c765ce3
Commit
6c765ce3
authored
May 05, 2010
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make routes maintain all three components of a metric.
parent
209707c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
route.c
route.c
+4
-2
route.h
route.h
+4
-2
No files found.
route.c
View file @
6c765ce3
...
@@ -259,7 +259,8 @@ change_route_metric(struct route *route, unsigned cost, unsigned add)
...
@@ -259,7 +259,8 @@ change_route_metric(struct route *route, unsigned cost, unsigned add)
}
}
}
}
route
->
metric
=
newmetric
;
route
->
cost
=
cost
;
route
->
add_metric
=
add
;
local_notify_route
(
route
,
LOCAL_CHANGE
);
local_notify_route
(
route
,
LOCAL_CHANGE
);
}
}
...
@@ -478,8 +479,9 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
...
@@ -478,8 +479,9 @@ update_route(const unsigned char *a, const unsigned char *p, unsigned char plen,
route
=
&
routes
[
numroutes
];
route
=
&
routes
[
numroutes
];
route
->
src
=
src
;
route
->
src
=
src
;
route
->
refmetric
=
refmetric
;
route
->
refmetric
=
refmetric
;
route
->
cost
=
neighbour_cost
(
neigh
);
route
->
add_metric
=
add_metric
;
route
->
seqno
=
seqno
;
route
->
seqno
=
seqno
;
route
->
metric
=
metric
;
route
->
neigh
=
neigh
;
route
->
neigh
=
neigh
;
memcpy
(
route
->
nexthop
,
nexthop
,
16
);
memcpy
(
route
->
nexthop
,
nexthop
,
16
);
route
->
time
=
now
.
tv_sec
;
route
->
time
=
now
.
tv_sec
;
...
...
route.h
View file @
6c765ce3
...
@@ -22,8 +22,9 @@ THE SOFTWARE.
...
@@ -22,8 +22,9 @@ THE SOFTWARE.
struct
route
{
struct
route
{
struct
source
*
src
;
struct
source
*
src
;
unsigned
short
metric
;
unsigned
short
refmetric
;
unsigned
short
refmetric
;
unsigned
short
cost
;
unsigned
short
add_metric
;
unsigned
short
seqno
;
unsigned
short
seqno
;
struct
neighbour
*
neigh
;
struct
neighbour
*
neigh
;
unsigned
char
nexthop
[
16
];
unsigned
char
nexthop
[
16
];
...
@@ -35,7 +36,8 @@ struct route {
...
@@ -35,7 +36,8 @@ struct route {
static
inline
int
static
inline
int
route_metric
(
const
struct
route
*
route
)
route_metric
(
const
struct
route
*
route
)
{
{
return
route
->
metric
;
int
m
=
route
->
refmetric
+
route
->
cost
+
route
->
add_metric
;
return
MIN
(
m
,
INFINITY
);
}
}
extern
struct
route
*
routes
;
extern
struct
route
*
routes
;
...
...
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