diff --git a/babeld/kernel.c b/babeld/kernel.c index aed6dc9c4f3f..4957b04e77d9 100644 --- a/babeld/kernel.c +++ b/babeld/kernel.c @@ -92,13 +92,9 @@ kernel_route(enum babel_kernel_routes operation, const unsigned char *pref, case ROUTE_MODIFY: if(newmetric == metric && memcmp(newgate, gate, 16) == 0 && newifindex == ifindex) - return 0; - debugf(BABEL_DEBUG_ROUTE, "Modify route: delete old; add new."); - rc = zebra_route(0, family, pref, plen, gate, ifindex, metric); - if (rc < 0) - return -1; + return 0; - rc = zebra_route(1, family, pref, plen, newgate, newifindex, + rc = zebra_route(1, family, pref, plen, newgate, newifindex, newmetric); return rc; } diff --git a/babeld/route.c b/babeld/route.c index 2c7e92374896..466f41383cb8 100644 --- a/babeld/route.c +++ b/babeld/route.c @@ -352,7 +352,7 @@ route_stream_done(struct route_stream *stream) static int metric_to_kernel(int metric) { - return metric < INFINITY ? kernel_metric : KERNEL_INFINITY; + return metric < INFINITY ? metric : KERNEL_INFINITY; } /* This is used to maintain the invariant that the installed route is at