From 4b79b85e4eb270dd2104c7fee4e5c9352f5703b7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 4 Aug 2013 01:51:06 +0200 Subject: Don't purge route entries before the purge timeout has passed --- src/babel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/babel.c') diff --git a/src/babel.c b/src/babel.c index 3c0e219..7842428 100644 --- a/src/babel.c +++ b/src/babel.c @@ -93,7 +93,11 @@ static void maintain_routes(gmrf_context_t *ctx) { gp_babel_route_update(ctx, route); - if (!route->nexthops) { + if (!route->nexthops && gp_babel_since(ctx, route->last_nexthop) > GP_BABEL_PURGE_TIMEOUT) { + gmrf_logf(ctx->gmrf, LOG_DEBUG, "node %04x%04x (%u, seqno=%04x): purging.", + ntohl(*(uint32_t*)route->node.id), ntohl(*(uint32_t*)(route->node.id+4)), + route->metric.metric, route->metric.seqno); + *cur = *next; next = cur; gp_babel_route_free(ctx, route); -- cgit v1.2.3