]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: V6 does not have route replace semantics
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 17 Nov 2017 16:01:44 +0000 (11:01 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 17 Nov 2017 16:13:01 +0000 (11:13 -0500)
The v6 linux kernel netlink code doees not have
route replace semantics.  So if we are in that
situation, do a delete/add to get the correct
results.

Fixes: #1461
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/rt_netlink.c

index e8333ef0cf645fbb32bc43aeae0872e099ba1911..a1ef5ba98670062bd3ea27efa54a7d0892d112f8 100644 (file)
@@ -1605,7 +1605,23 @@ int kernel_route_rib(struct prefix *p, struct prefix *src_p,
        if (old && !new)
                return netlink_route_multipath(RTM_DELROUTE, p, src_p, old, 0);
 
-       return netlink_route_multipath(RTM_NEWROUTE, p, src_p, new, 1);
+       if (p->family == AF_INET)
+               return netlink_route_multipath(RTM_NEWROUTE, p, src_p, new, 1);
+
+       /*
+        * So v6 route replace semantics are not in the kernel at this
+        * point as I understand it.
+        * So let's do a delete than an add.
+        * In the future once v6 route replace semantics are in
+        * we can figure out what to do here to allow working
+        * with old and new kernels.
+        *
+        * I'm also intentionally ignoring the failure case
+        * of the route delete.  If that happens yeah we're
+        * screwed.
+        */
+       netlink_route_multipath(RTM_DELROUTE, p, src_p, old, 0);
+       return netlink_route_multipath(RTM_NEWROUTE, p, src_p, new, 0);
 }
 
 int kernel_neigh_update(int add, int ifindex, uint32_t addr, char *lla,