Send triggered updates

This commit is contained in:
Matthias Schiffer 2013-08-04 01:59:28 +02:00
parent 4b79b85e4e
commit ef586cf976

View file

@ -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) {