zebra: fix wrong linkdown flag

Add this one line command to one down interface (mask is 192.168.0.0/24):
```
ip link set dev enp2s0 up;ip route add 3.3.3.3/32 via 192.168.0.1 dev enp2s0 proto kernel onlink
```

Before:
```
K>* 3.3.3.3/32 [0/0] via 192.168.0.1, enp2s0 onlink linkdown, weight 1, 00:00:02
```

After:
```
K>* 3.3.3.3/32 [0/0] via 192.168.0.1, enp2s0 onlink, weight 1, 00:00:02
```

It's only display problem, just correct this linkdown flag.

Signed-off-by: anlan_cs <anlan_cs@126.com>
This commit is contained in:
anlan_cs 2024-11-09 22:11:33 +08:00
parent b365b0ff24
commit 61a042f112

View file

@ -3919,6 +3919,7 @@ void zebra_interface_nhg_reinstall(struct interface *ifp)
"%s install nhe %pNG nh type %u flags 0x%x",
__func__, rb_node_dep->nhe, nh->type,
rb_node_dep->nhe->flags);
UNSET_FLAG(nh->flags, NEXTHOP_FLAG_LINKDOWN);
zebra_nhg_install_kernel(rb_node_dep->nhe,
ZEBRA_ROUTE_MAX);