]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Babel: Do not maintain feasibility distance for our own routes
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 19 Jul 2016 12:38:36 +0000 (14:38 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 19 Jul 2016 12:38:36 +0000 (14:38 +0200)
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>
proto/babel/babel.c

index 3b3b98702f59ad82d36ea83d16db10fa9763b78c..8164f2f3c287612e5ca2890790771ef71e49c45c 100644 (file)
@@ -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;
 }