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)
newmetric = route->metric;
/* Switching sources can cause transient routing loops, so always send
updates in that case. Retractions are always urgent. */
if(route->src != oldsrc ||
(oldmetric < INFINITY && newmetric >= INFINITY))
if(route->src != oldsrc || (oldmetric < INFINITY && newmetric >= INFINITY))
/* Switching sources can cause transient routing loops.
Retractions are always urgent. */
urgent = 1;
/* This is not strictly necessary, but it speeds up reconvergence */
if(newmetric >= oldmetric + 512 || oldmetric >= newmetric + 512)
else if(newmetric >= 8 * 256 && oldmetric >= 8 * 256)
/* Don't be noisy about far-away nodes */
urgent = -1;
else if(newmetric >= oldmetric + 512 || oldmetric >= newmetric + 512)
urgent = 1;
/* Make sure that requests are satisfied speedily */
......@@ -555,6 +554,9 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric)
route->seqno, hash_id(route->src->id)))
urgent = 1;
if(urgent < 0)
return;
if(urgent ||
(newmetric >= oldmetric + 256 || oldmetric >= newmetric + 256))
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