From ef586cf976550dd7877180be0c3b3368db820031 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 4 Aug 2013 01:59:28 +0200 Subject: Send triggered updates --- src/route.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/route.c b/src/route.c index 4daea64..3d54d35 100644 --- a/src/route.c +++ b/src/route.c @@ -183,13 +183,16 @@ void gp_babel_route_update(gmrf_context_t *ctx, gp_babel_route_t *route) { gp_babel_send_seqno_request_for(ctx, NULL, route); /* triggered updates */ - /*int diff = route->metric.metric - route->last_metric; + int diff = route->metric.metric - route->last_metric; if (((route->last_metric == GP_BABEL_INFINITY) != (route->metric.metric == GP_BABEL_INFINITY)) || diff <= -1024 || diff >= 384) { - gmrf_logf(gmrf, LOG_INFO, "route metric has changed significantly, sending updates"); - gp_babel_update_enqueue(&route->node, route->type, route->key, NULL, route->metric.metric == GP_BABEL_INFINITY); - } */ + gmrf_logf(ctx->gmrf, LOG_INFO, "route metric has changed significantly, sending updates"); + + gmrf_iface_state_t *iface; + for (iface = ctx->interfaces; iface; iface = iface->next) + gp_babel_send_update_for_route(ctx, iface, NULL, route); + } } void gp_babel_route_update_nexthop(gmrf_context_t *ctx, gp_babel_route_t *route, gp_babel_nexthop_t *nexthop, gp_babel_metric_seqno_t ms, uint16_t interval) { -- cgit v1.2.3