]> git.puffer.fish Git - matthieu/frr.git/commit
zebra: fix wrong nexthop check
authoranlan_cs <anlan_cs@126.com>
Sat, 30 Nov 2024 13:11:04 +0000 (21:11 +0800)
committeranlan_cs <anlan_cs@126.com>
Tue, 17 Dec 2024 08:14:30 +0000 (16:14 +0800)
commitb9538fe481d1955090e41c04d86b2322362a83f5
tree388c4ade225bb7ea009342a07a67d272d91edbbf
parentb28ee727c9b88ee14983defc3c6f4e0b20ef573c
zebra: fix wrong nexthop check

The kernel routes are wrongly selected even the nexthop interface is linkdown.

Use `ip link set dev <interface> down` on the other box to set the box's
nexthop interface linkdown. The kernel routes will be kept as `linkdown`,
but are still with active nexthop in `zebra`.

Add three changes/commits for kernel routes in this PR:

1) The active nexthop should be the operative interface.
2) Don't uninstall the kernel routes from `zebra` even no active nexthops.
   (It doesn't affect the kernel routes' deletion from kernel netlink messages.)
3) Update the kernel routes when the nexthop interface becomes up.

Before: (during nexthop interface is linkdown)
```
K>* 3.3.3.3/32 [0/0] via 88.88.88.1, enp2s0, weight 1, 00:00:14
```

After: (during nexthop interface is linkdown, with all three changes)
```
K   3.3.3.3/32 [0/0] via 88.88.88.1, enp2s0 inactive, weight 1, 00:00:07
```

This commit is 1st change:
Improve the judgment for "active" nexthop to be more accurate, the active
nexthop should be the operative interface.

Signed-off-by: anlan_cs <anlan_cs@126.com>
zebra/zebra_nhg.c