summaryrefslogtreecommitdiff
path: root/proto/babel
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-07-19 14:38:36 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-07-19 14:38:36 +0200
commitc6ed5a0f9925476714d6b351c61dbce704a4f09d (patch)
treec54026265376a1787b148d430b14fa25d6b874f2 /proto/babel
parent0f673666017bfc9c05c9495ae53bc323b9dc6660 (diff)
Babel: Do not maintain feasibility distance for our own routes
We do not need to maintain feasibility distances for our own router ID (we ignore the updates anyway). Not doing so makes the routes be garbage collected sooner when export filters change. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Diffstat (limited to 'proto/babel')
-rw-r--r--proto/babel/babel.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 3b3b9870..8164f2f3 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -788,16 +788,21 @@ babel_send_update(struct babel_iface *ifa, bird_clock_t changed)
msg.update.prefix = e->n.prefix;
msg.update.router_id = r->router_id;
- /* Update feasibility distance */
- struct babel_source *s = babel_get_source(e, r->router_id);
- s->expires = now + BABEL_GARBAGE_INTERVAL;
- if ((msg.update.seqno > s->seqno) ||
- ((msg.update.seqno == s->seqno) && (msg.update.metric < s->metric)))
+ babel_enqueue(&msg, ifa);
+
+ /* Update feasibility distance for redistributed routes */
+ if (!OUR_ROUTE(r))
{
- s->seqno = msg.update.seqno;
- s->metric = msg.update.metric;
+ struct babel_source *s = babel_get_source(e, r->router_id);
+ s->expires = now + BABEL_GARBAGE_INTERVAL;
+
+ if ((msg.update.seqno > s->seqno) ||
+ ((msg.update.seqno == s->seqno) && (msg.update.metric < s->metric)))
+ {
+ s->seqno = msg.update.seqno;
+ s->metric = msg.update.metric;
+ }
}
- babel_enqueue(&msg, ifa);
}
FIB_WALK_END;
}