]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix route replace v4 semantics with new system route
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 29 Jul 2019 15:10:25 +0000 (11:10 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 29 Jul 2019 15:39:06 +0000 (11:39 -0400)
When a new system route comes in and we have a pre-existing
non-system route we are not deleting the current system
route from the linux kernel.

Modify the code such that when a route replace is sent
to the kernel with a new route as a system route and
the old route as a non-system route do a delete of
the old route so it is no longer in the kernel.

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

index b1d0c1e3a69ee78099ef8e276fbaa1dc76750bec..95ac68fb90121f2d490181dc9ad550433000a0b2 100644 (file)
@@ -1833,6 +1833,19 @@ enum zebra_dplane_result kernel_route_update(struct zebra_dplane_ctx *ctx)
                if (p->family == AF_INET || v6_rr_semantics) {
                        /* Single 'replace' operation */
                        cmd = RTM_NEWROUTE;
+
+                       /*
+                        * With route replace semantics in place
+                        * for v4 routes and the new route is a system
+                        * route we do not install anything.
+                        * The problem here is that the new system
+                        * route should cause us to withdraw from
+                        * the kernel the old non-system route
+                        */
+                       if (RSYSTEM_ROUTE(dplane_ctx_get_type(ctx)) &&
+                           !RSYSTEM_ROUTE(dplane_ctx_get_old_type(ctx)))
+                               (void)netlink_route_multipath(RTM_DELROUTE,
+                                                             ctx);
                } else {
                        /*
                         * So v6 route replace semantics are not in