[PATCH 7/7] Babel: Don't maintain feasibility distance for our own routes.
Toke Høiland-Jørgensen
toke at toke.dk
Mon May 2 19:07:55 CEST 2016
We don't 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 at toke.dk>
---
proto/babel/babel.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index a40d848..826f718 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -788,14 +788,17 @@ 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)))
+ /* Update feasibility distance if it's not our own route. */
+ if (r->router_id != p->router_id)
{
- 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);
}
--
2.8.0
More information about the Bird-users
mailing list