Don't handle "lost" routes when the route didn't have a selected nexthop before

This commit is contained in:
Matthias Schiffer 2014-03-23 16:36:21 +01:00
parent 5a077ac884
commit b57074f83e

View file

@ -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 */