]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Only send down pertinent information on RTM_DELROUTE 2043/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 9 Apr 2018 18:16:00 +0000 (14:16 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 9 Apr 2018 18:16:00 +0000 (14:16 -0400)
Background:

v6 does not have route replace semantics.  If you want to add a nexthop
to an existing route, you just send RTM_NEWROUTE and the new nexthop.
If you want to delete a nexthop you should just send RTM_DELROUTE
with the removed nexthop.

This leads to situations where if zebra is processing a route
and has lost track of intermediate nexthops( yes this sucks )
then v6 routes will get out of sync when we try to implement
route replace semantics.

So notice when we are doing a route delete and the route is
not being updated, just send the prefix and tell it too delete.

Ticket: CM-20391
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/rt_netlink.c

index 85e0963b25da49a4bd49d10ca3133080a922aa7d..6dd0da8d5ac2ee4f14598edbbca1be41fa73d68b 100644 (file)
@@ -1319,7 +1319,6 @@ static int netlink_route_multipath(int cmd, struct prefix *p,
        struct sockaddr_nl snl;
        struct nexthop *nexthop = NULL;
        unsigned int nexthop_num;
-       int discard = 0;
        int family = PREFIX_FAMILY(p);
        const char *routedesc;
        int setsrc = 0;
@@ -1380,7 +1379,13 @@ static int netlink_route_multipath(int cmd, struct prefix *p,
 
        _netlink_route_debug(cmd, p, family, zvrf, re->table);
 
-       if (discard)
+       /*
+        * If we are not updating the route and we have received
+        * a route delete, then all we need to fill in is the
+        * prefix information to tell the kernel to schwack
+        * it.
+        */
+       if (!update && cmd == RTM_DELROUTE)
                goto skip;
 
        if (re->mtu || re->nexthop_mtu) {