]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Add notification for Route Install events
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 9 Nov 2017 19:42:50 +0000 (14:42 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 27 Nov 2017 14:09:36 +0000 (09:09 -0500)
When we are installing into the kernel, not the
change points for notification to a higher level
protocol and make it happen

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

index e96a988edf410b2805152a0d4d925ed571986f33..b7b68b72722d5709d7e801e469e7192c7a1c2dd1 100644 (file)
@@ -1028,6 +1028,13 @@ int rib_install_kernel(struct route_node *rn, struct route_entry *re,
                }
        }
 
+       /*
+        * If this is a replace to a new RE let the originator of the RE
+        * know that they've lost
+        */
+       if (old && old != re)
+               zsend_route_notify_owner(old->type, old->vrf_id,
+                                        p, ZAPI_ROUTE_BETTER_ADMIN_WON);
 
        /*
         * Make sure we update the FPM any time we send new information to
@@ -1048,7 +1055,11 @@ int rib_install_kernel(struct route_node *rn, struct route_entry *re,
                        else
                                UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
                }
-       }
+               zsend_route_notify_owner(re->type, re->vrf_id,
+                                        p, ZAPI_ROUTE_INSTALLED);
+       } else
+               zsend_route_notify_owner(re->type, re->vrf_id,
+                                        p, ZAPI_ROUTE_FAIL_INSTALL);
 
        return ret;
 }