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
16e1a45e
Commit
16e1a45e
authored
Jun 30, 2012
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid microoptimisation in route_changed.
This is brittle, and prevents me from making route selection smarter.
parent
1b2f8d62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
route.c
route.c
+7
-9
No files found.
route.c
View file @
16e1a45e
...
@@ -938,17 +938,15 @@ route_changed(struct babel_route *route,
...
@@ -938,17 +938,15 @@ route_changed(struct babel_route *route,
struct
source
*
oldsrc
,
unsigned
short
oldmetric
)
struct
source
*
oldsrc
,
unsigned
short
oldmetric
)
{
{
if
(
route
->
installed
)
{
if
(
route
->
installed
)
{
if
(
route_metric
(
route
)
>
oldmetric
)
{
struct
babel_route
*
better_route
;
struct
babel_route
*
better_route
;
/* Do this unconditionally -- microoptimisation is not worth it. */
better_route
=
better_route
=
find_best_route
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
1
,
NULL
);
find_best_route
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
1
,
NULL
);
if
(
better_route
&&
if
(
better_route
&&
route_metric
(
better_route
)
<
route_metric
(
route
))
route_metric
(
better_route
)
<=
route_metric
(
route
)
-
96
)
consider_route
(
better_route
);
consider_route
(
better_route
);
}
if
(
route
->
installed
)
if
(
route
->
installed
)
/* We didn't
change routes after all
. */
/* We didn't
switch to the better route
. */
send_triggered_update
(
route
,
oldsrc
,
oldmetric
);
send_triggered_update
(
route
,
oldsrc
,
oldmetric
);
}
else
{
}
else
{
/* Reconsider routes even when their metric didn't decrease,
/* Reconsider routes even when their metric didn't decrease,
...
...
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