From b57074f83ea6163afe2525cd8b372cc8332635d7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 23 Mar 2014 16:36:21 +0100 Subject: Don't handle "lost" routes when the route didn't have a selected nexthop before --- src/route.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/route.c b/src/route.c index fed699c..bffb4c7 100644 --- a/src/route.c +++ b/src/route.c @@ -130,6 +130,8 @@ static gp_babel_metric_seqno_t get_metric(gmrf_context_t *ctx, const gp_babel_ro } static void update_nexthop(gmrf_context_t *ctx, gp_babel_route_t *route) { + bool had_selected = route->selected; + route->selected = select_nexthop(ctx, route); route->metric = get_metric(ctx, route); @@ -139,9 +141,11 @@ static void update_nexthop(gmrf_context_t *ctx, gp_babel_route_t *route) { &route->selected->neigh->addr, route->metric.metric); } else { - gp_babel_send_seqno_request_for(ctx, NULL, route); + if (had_selected) { + gp_babel_send_seqno_request_for(ctx, NULL, route); - gmrf_debug_route_lost(ctx->gmrf, route->node.id, sizeof(gp_babel_node_id_t)); + gmrf_debug_route_lost(ctx->gmrf, route->node.id, sizeof(gp_babel_node_id_t)); + } } /* triggered updates */ -- cgit v1.2.3