diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-05-14 10:11:30 -0700 |
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-25 11:13:39 -0400 |
| commit | f862383fc9f0055dc068d5374e5efc7b49a23e2e (patch) | |
| tree | 398dccd04d2c0c6679cc6910208eb91291d4f5bc /zebra/interface.c | |
| parent | fe593b781d8a927bd496c77799312cc64a565141 (diff) | |
zebra: Add interface down marking to NHE's
Add functionality to allow an interface down event to mark
any dependent NHE's as invalid.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 8fe7af3f2a..798cb92690 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -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 |
