diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-04 01:59:28 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-04 01:59:28 +0200 |
commit | ef586cf976550dd7877180be0c3b3368db820031 (patch) | |
tree | 71df69de029e1b94bf64550817d84073207a97fe /src | |
parent | 4b79b85e4eb270dd2104c7fee4e5c9352f5703b7 (diff) | |
download | babel-ef586cf976550dd7877180be0c3b3368db820031.tar babel-ef586cf976550dd7877180be0c3b3368db820031.zip |
Send triggered updates
Diffstat (limited to 'src')
-rw-r--r-- | src/route.c | 11 |
1 files 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) { |