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
e75f922c
Commit
e75f922c
authored
Aug 25, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify send_triggered_update.
parent
dda1e777
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
route.c
route.c
+12
-7
No files found.
route.c
View file @
e75f922c
...
@@ -442,19 +442,24 @@ consider_route(struct route *route)
...
@@ -442,19 +442,24 @@ consider_route(struct route *route)
void
void
send_triggered_update
(
struct
route
*
route
,
struct
source
*
oldsrc
,
int
oldmetric
)
send_triggered_update
(
struct
route
*
route
,
struct
source
*
oldsrc
,
int
oldmetric
)
{
{
int
urgent
,
newmetric
;
if
(
!
route
->
installed
)
if
(
!
route
->
installed
)
return
;
return
;
newmetric
=
route
->
metric
;
/* Switching sources can cause transient routing loops, so always send
/* Switching sources can cause transient routing loops, so always send
updates in that case */
updates in that case. Retractions are always urgent. */
if
(
route
->
src
!=
oldsrc
||
urgent
=
(
route
->
src
!=
oldsrc
)
||
((
route
->
metric
>=
INFINITY
)
!=
(
oldmetric
>=
INFINITY
))
||
(
oldmetric
<
INFINITY
&&
newmetric
>=
INFINITY
);
(
route
->
metric
>=
oldmetric
+
256
||
oldmetric
>=
route
->
metric
+
256
))
send_update
(
NULL
,
((
route
->
metric
>=
INFINITY
)
||
route
->
src
!=
oldsrc
),
if
(
urgent
||
route
->
src
->
prefix
,
route
->
src
->
plen
);
(
newmetric
>=
oldmetric
+
256
||
oldmetric
>=
newmetric
+
256
))
send_update
(
NULL
,
urgent
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
if
(
oldmetric
<
INFINITY
)
{
if
(
oldmetric
<
INFINITY
)
{
if
(
route
->
metric
>=
INFINITY
||
route
->
metric
-
oldmetric
>=
384
)
if
(
newmetric
>=
INFINITY
||
newmetric
>=
oldmetric
+
384
)
send_request
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
send_request
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
}
}
}
}
...
...
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