Skip to content

Commit 3be8b48

Browse files
committed
zebra: Reinstall nexthop when interface comes back up
If a interface down event caused a nexthop group to remove one of the entries in the kernel, have it be reinstalled when the interface comes back up. Mark the nexthop as usable. new behavior: eva# show nexthop-group rib 181818168 ID: 181818168 (sharp) RefCnt: 1 Uptime: 00:00:23 VRF: default(bad-value) Valid, Installed Depends: (35) (38) (44) (51) via 192.168.99.33, dummy1 (vrf default), weight 1 via 192.168.100.33, dummy2 (vrf default), weight 1 via 192.168.101.33, dummy3 (vrf default), weight 1 via 192.168.102.33, dummy4 (vrf default), weight 1 eva# conf eva(config)# int dummy3 eva(config-if)# shut eva(config-if)# do show nexthop-group rib 181818168 ID: 181818168 (sharp) RefCnt: 1 Uptime: 00:00:44 VRF: default(bad-value) Depends: (35) (38) (44) (51) via 192.168.99.33, dummy1 (vrf default), weight 1 via 192.168.100.33, dummy2 (vrf default), weight 1 via 192.168.101.33, dummy3 (vrf default) inactive, weight 1 via 192.168.102.33, dummy4 (vrf default), weight 1 eva(config-if)# no shut eva(config-if)# do show nexthop-group rib 181818168 ID: 181818168 (sharp) RefCnt: 1 Uptime: 00:00:53 VRF: default(bad-value) Valid, Installed Depends: (35) (38) (44) (51) via 192.168.99.33, dummy1 (vrf default), weight 1 via 192.168.100.33, dummy2 (vrf default), weight 1 via 192.168.101.33, dummy3 (vrf default), weight 1 via 192.168.102.33, dummy4 (vrf default), weight 1 eva(config-if)# exit eva(config)# exit eva# exit sharpd@eva ~/frr1 (master) [255]> ip nexthop show id 181818168 id 181818168 group 35/38/44/51 proto 194 sharpd@eva ~/frr1 (master)> Signed-off-by: Donald Sharp <[email protected]>
1 parent ce166ca commit 3be8b48

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

zebra/zebra_nhg.c

+11
Original file line numberDiff line numberDiff line change
@@ -3782,6 +3782,17 @@ void zebra_interface_nhg_reinstall(struct interface *ifp)
37823782
frr_each_safe (nhg_connected_tree,
37833783
&rb_node_dep->nhe->nhg_dependents,
37843784
rb_node_dependent) {
3785+
struct nexthop *nhop_dependent =
3786+
rb_node_dependent->nhe->nhg.nexthop;
3787+
3788+
while (nhop_dependent &&
3789+
!nexthop_same(nhop_dependent, nh))
3790+
nhop_dependent = nhop_dependent->next;
3791+
3792+
if (nhop_dependent)
3793+
SET_FLAG(nhop_dependent->flags,
3794+
NEXTHOP_FLAG_ACTIVE);
3795+
37853796
if (IS_ZEBRA_DEBUG_NHG)
37863797
zlog_debug("%s dependent nhe %pNG Setting Reinstall flag",
37873798
__func__,

0 commit comments

Comments
 (0)