Commit e5f4675
committed
zebra: Prevent active setting if interface is not operative
Currently Installing nhg's has two paths for installation:
a) A route comes in with a new nhg that will be selected.
Zebra will check that the nexthops are good and signal
that the route is ready for installation. This in turn
causes the nexthop to be installed first before the route
installation. This nexthop group installation then looks
at each singleton and attempts to install those as well.
This is a way to get routes installed quickly into the system
if needed.
b) A interface has an event that causes a nexthop group
to change. This will cause singletons to be handled appropriately
and then once those are handled and installed the handler
for the nexthop install success will walk the nexthop groups
that use that nexthop and reinstalls them as well.
Unfortunately both A and B are currently funneled through
the same function.
Now for the problem that is being seen:
If you have a NHG A that uses NHG B/C/D nexthops. Imagine
that the B and C interfaces are down. The NHG A will have
B( inactive/!installed), C(inactive/!installed), D(active/installed)
Now if interface B comes up, this will cause nexthop B to be
reinstalled. After B comes back up we will call a nexthop
group reinstallation for A. Since it is using the same
functionality to reinstall, it looks at all it's singletons
and sees that C is not installed and it was marking C as active,
even though the interface is down) and attempting to reinstall it.
Unfortunately if interface C happens to be up in the kernel, but
not yet in zebra, you end up with nh C being installed and we
mark the nh C as valid and installed. Then when interface
C actually comes up, it sees that the nhg C is up and does
nothing. Leaving the nhg's in a broken state.
Modify the active setting to not set a singleton NH as
active if the interface is not operational.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>1 parent 46044a4 commit e5f4675
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2814 | 2814 | | |
2815 | 2815 | | |
2816 | 2816 | | |
2817 | | - | |
2818 | | - | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
2819 | 2825 | | |
2820 | 2826 | | |
2821 | 2827 | | |
| |||
0 commit comments