]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Add interface down marking to NHE's
authorStephen Worley <sworley@cumulusnetworks.com>
Tue, 14 May 2019 17:11:30 +0000 (10:11 -0700)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:39 +0000 (11:13 -0400)
Add functionality to allow an interface down event to mark
any dependent NHE's as invalid.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/interface.c
zebra/interface.h

index 8fe7af3f2acafd74c37d49d2fedee5dd55eac1e8..798cb926905e29fc155780bd870fa5c78af7723d 100644 (file)
@@ -983,7 +983,17 @@ bool if_nhg_dependents_is_empty(const struct interface *ifp)
        return false;
 }
 
+void if_down_nhg_dependents(const struct interface *ifp)
 {
+       if (!if_nhg_dependents_is_empty(ifp)) {
+               struct nhg_connected *rb_node_dep = NULL;
+               struct zebra_if *zif = (struct zebra_if *)ifp->info;
+
+               RB_FOREACH (rb_node_dep, nhg_connected_head,
+                           &zif->nhg_dependents) {
+                       zebra_nhg_set_invalid(rb_node_dep->nhe);
+               }
+       }
 }
 
 /* Interface is up. */
@@ -1049,6 +1059,8 @@ void if_down(struct interface *ifp)
        zif->down_count++;
        quagga_timestamp(2, zif->down_last, sizeof(zif->down_last));
 
+       if_down_nhg_dependents(ifp);
+
        /* Handle interface down for specific types for EVPN. Non-VxLAN
         * interfaces
         * are checked to see if (remote) neighbor entries need to be purged
index d5c1e1713193f22df5a1c23046feed9f26f8170c..c5614a2a604bbf97f0f834e26544dfd380732b10 100644 (file)
@@ -441,6 +441,7 @@ extern void if_nhg_dependents_del(struct interface *ifp,
                                  struct nhg_hash_entry *nhe);
 extern unsigned int if_nhg_dependents_count(const struct interface *ifp);
 extern bool if_nhg_dependents_is_empty(const struct interface *ifp);
+extern void if_down_nhg_dependents(const struct interface *ifp);
 
 extern void vrf_add_update(struct vrf *vrfp);