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
0144848a
Commit
0144848a
authored
Apr 02, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite send_triggered_update.
parent
d97aecee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
route.c
route.c
+17
-15
No files found.
route.c
View file @
0144848a
...
...
@@ -539,41 +539,43 @@ consider_route(struct route *route)
void
send_triggered_update
(
struct
route
*
route
,
struct
source
*
oldsrc
,
int
oldmetric
)
{
int
urgent
=
0
,
newmetric
;
int
urgent
=
0
,
newmetric
,
diff
;
if
(
!
route
->
installed
)
return
;
newmetric
=
route
->
metric
;
diff
=
newmetric
>=
oldmetric
?
newmetric
-
oldmetric
:
oldmetric
-
newmetric
;
if
(
route
->
src
!=
oldsrc
||
(
oldmetric
<
INFINITY
&&
newmetric
>=
INFINITY
))
/* Switching sources can cause transient routing loops.
Retractions are always urgent. */
urgent
=
2
;
else
if
(
newmetric
>=
8
*
256
&&
oldmetric
>=
8
*
256
)
else
if
(
newmetric
>=
6
*
256
&&
oldmetric
>=
6
*
256
)
/* Don't be noisy about far-away nodes */
urgent
=
-
1
;
else
if
(
newmetric
>=
oldmetric
+
512
||
oldmetric
>=
newmetric
+
512
)
else
if
(
diff
>=
512
)
urgent
=
1
;
/* Make sure that requests are satisfied speedily */
if
(
unsatisfied_request
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
seqno
,
hash_id
(
route
->
src
->
id
)))
urgent
=
MAX
(
urgent
,
1
);
if
(
urgent
<
1
)
{
if
(
unsatisfied_request
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
seqno
,
hash_id
(
route
->
src
->
id
)))
urgent
=
1
;
}
if
(
urgent
<
0
)
if
(
urgent
<
0
||
(
!
urgent
&&
diff
<
256
))
/* Never mind. */
return
;
if
(
urgent
||
(
newmetric
>=
oldmetric
+
256
||
oldmetric
>=
newmetric
+
256
))
{
if
(
urgent
>=
2
)
send_update_resend
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
else
send_update
(
NULL
,
urgent
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
}
if
(
urgent
>=
2
)
send_update_resend
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
else
send_update
(
NULL
,
urgent
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
if
(
oldmetric
<
INFINITY
)
{
if
(
newmetric
>=
INFINITY
||
newmetric
>=
oldmetric
+
384
)
{
if
(
newmetric
>=
oldmetric
+
384
)
{
send_request_resend
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
src
->
metric
>=
INFINITY
?
route
->
src
->
seqno
:
...
...
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