Commit da1622ec authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't send triggered updates about far-away nodes.

parent 2452be1e
...@@ -539,15 +539,14 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric) ...@@ -539,15 +539,14 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric)
newmetric = route->metric; newmetric = route->metric;
/* Switching sources can cause transient routing loops, so always send if(route->src != oldsrc || (oldmetric < INFINITY && newmetric >= INFINITY))
updates in that case. Retractions are always urgent. */ /* Switching sources can cause transient routing loops.
Retractions are always urgent. */
if(route->src != oldsrc ||
(oldmetric < INFINITY && newmetric >= INFINITY))
urgent = 1; urgent = 1;
else if(newmetric >= 8 * 256 && oldmetric >= 8 * 256)
/* This is not strictly necessary, but it speeds up reconvergence */ /* Don't be noisy about far-away nodes */
if(newmetric >= oldmetric + 512 || oldmetric >= newmetric + 512) urgent = -1;
else if(newmetric >= oldmetric + 512 || oldmetric >= newmetric + 512)
urgent = 1; urgent = 1;
/* Make sure that requests are satisfied speedily */ /* Make sure that requests are satisfied speedily */
...@@ -555,6 +554,9 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric) ...@@ -555,6 +554,9 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric)
route->seqno, hash_id(route->src->id))) route->seqno, hash_id(route->src->id)))
urgent = 1; urgent = 1;
if(urgent < 0)
return;
if(urgent || if(urgent ||
(newmetric >= oldmetric + 256 || oldmetric >= newmetric + 256)) (newmetric >= oldmetric + 256 || oldmetric >= newmetric + 256))
send_update(NULL, urgent, route->src->prefix, route->src->plen); send_update(NULL, urgent, route->src->prefix, route->src->plen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment