Commit fb3cba7d authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add comment in update_source.

parent 4933f230
...@@ -116,6 +116,10 @@ update_source(struct source *src, ...@@ -116,6 +116,10 @@ update_source(struct source *src,
if(metric >= INFINITY) if(metric >= INFINITY)
return; return;
/* If a source is expired, pretend that it doesn't exist and update
it unconditionally. This makes ensures that old data will
eventually be overridden, and prevents us from getting stuck if
a router loses its sequence number. */
if(src->time < now.tv_sec - SOURCE_GC_TIME || if(src->time < now.tv_sec - SOURCE_GC_TIME ||
seqno_compare(src->seqno, seqno) < 0 || seqno_compare(src->seqno, seqno) < 0 ||
(src->seqno == seqno && src->metric > metric)) { (src->seqno == seqno && src->metric > metric)) {
......
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