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
d839fc55
Commit
d839fc55
authored
Mar 11, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More smarts when forwarding requests.
parent
655c4f3d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
message.c
message.c
+1
-1
route.c
route.c
+6
-3
route.h
route.h
+1
-1
No files found.
message.c
View file @
d839fc55
...
...
@@ -268,7 +268,7 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix,
route
=
find_installed_route
(
prefix
,
plen
);
if
(
!
route
||
route
->
metric
>=
INFINITY
||
route
->
neigh
==
neigh
)
route
=
find_best_route
(
prefix
,
plen
,
0
);
route
=
find_best_route
(
prefix
,
plen
,
0
,
neigh
);
if
(
!
route
||
route
->
metric
>=
INFINITY
||
route
->
neigh
==
neigh
)
return
;
if
(
router_hash
==
hash_id
(
route
->
src
->
address
)
&&
...
...
route.c
View file @
d839fc55
...
...
@@ -242,7 +242,8 @@ update_feasible(const unsigned char *a,
/* This returns the feasible route with the smallest metric. */
struct
route
*
find_best_route
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
int
feasible
)
find_best_route
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
int
feasible
,
struct
neighbour
*
exclude
)
{
struct
route
*
route
=
NULL
;
int
i
;
...
...
@@ -254,6 +255,8 @@ find_best_route(const unsigned char *prefix, unsigned char plen, int feasible)
continue
;
if
(
feasible
&&
!
route_feasible
(
&
routes
[
i
]))
continue
;
if
(
exclude
&&
routes
[
i
].
neigh
==
exclude
)
continue
;
if
(
route
&&
route
->
metric
<=
routes
[
i
].
metric
)
continue
;
route
=
&
routes
[
i
];
...
...
@@ -575,7 +578,7 @@ trigger_route_change(struct route *route,
if
(
route
->
metric
>
oldmetric
)
{
struct
route
*
better_route
;
better_route
=
find_best_route
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
1
);
find_best_route
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
1
,
NULL
);
if
(
better_route
&&
better_route
->
metric
<=
route
->
metric
-
96
)
consider_route
(
better_route
);
}
...
...
@@ -593,7 +596,7 @@ void
route_lost
(
struct
source
*
src
,
int
oldmetric
)
{
struct
route
*
new_route
;
new_route
=
find_best_route
(
src
->
prefix
,
src
->
plen
,
1
);
new_route
=
find_best_route
(
src
->
prefix
,
src
->
plen
,
1
,
NULL
);
if
(
new_route
)
{
consider_route
(
new_route
);
}
else
{
...
...
route.h
View file @
d839fc55
...
...
@@ -54,7 +54,7 @@ int update_feasible(const unsigned char *a,
const
unsigned
char
*
p
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
refmetric
);
struct
route
*
find_best_route
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
int
feasible
);
int
feasible
,
struct
neighbour
*
exclude
);
struct
route
*
install_best_route
(
const
unsigned
char
prefix
[
16
],
unsigned
char
plen
);
void
update_neighbour_metric
(
struct
neighbour
*
neigh
);
...
...
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