-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zebra: set ZEBRA_IFC_DOWN on connected routes for inactive interfaces #11004
Conversation
Thanks to @zdc for the original reproducer Open questions:
|
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-4797/ This is a comment from an automated CI system. |
zebra/connected.c
Outdated
@@ -326,7 +326,7 @@ void connected_add_ipv4(struct interface *ifp, int flags, | |||
ifc->metric = metric; | |||
/* If we get a notification from the kernel, | |||
* we can safely assume the address is known to the kernel */ | |||
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED); | |||
SET_FLAG(ifc->conf, ZEBRA_IFC_DOWN | ZEBRA_IFC_QUEUED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's only add the ZEBRA_IFC_DOWN flag if the interface is actually down
if (if_up(ifp))
SET_FLAG(ifc->conf, ZEBRA_IFC_DOWN);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have hidden it under if_is_operative(ifp)
if I have understood you correctly
can you remove the merge commit with a rebase and a force push and I'll get this in |
If you are in a situation where you have multiple addresses on an interface, zebra creates one connected route for them. The issue is that the rib entry is not created if addresses were added before the interface was running. We add the address to a running interface in a typical flow. Therefore, we handle the route & rib creation within a single ADD event. In the opposite case, we create the route entries without activating them. These are considered to be active since ZEBRA_IFC_DOWN is not set. On the following interface UP, we ignore the same ADDR_ADD as it overlaps with the existing prefixes -> rib is never created. The minimal reproducible setup: ----------------------------------------- ip link add name dummy0 type dummy ip addr flush dev dummy0 ip link set dummy0 down ip addr add 192.168.1.7/24 dev dummy0 ip addr add 192.168.1.8/24 dev dummy0 ip link set dummy0 up vtysh -c 'show ip route' | grep dummy0 Signed-off-by: Volodymyr Huti <v.huti@vyos.io>
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-4957/ This is a comment from an automated CI system. |
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-4960/ This is a comment from an automated CI system. |
@Mergifyio backport stable/8.2 |
✅ Backports have been created
|
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-4956/ This is a comment from an automated CI system. |
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-4959/ This is a comment from an automated CI system. |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-4955/ This is a comment from an automated CI system. |
zebra: set ZEBRA_IFC_DOWN on connected routes for inactive interfaces (backport #11004)
If you are in a situation where you have multiple addresses on an
interface, zebra creates one connected route for them.
The issue is that the rib entry is not created if addresses were
added before the interface was running.
We add the address to a running interface in a typical flow.
Therefore, we handle the route & rib creation within a single ADD event.
In the opposite case, we create the route entries without activating them.
These are considered to be active since ZEBRA_IFC_DOWN is not set.
On the following interface UP, we ignore the same ADDR_ADD as it overlaps
with the already
active
prefixes -> rib is never created.The minimal reproducible setup:
ip link add name dummy0 type dummy
ip addr flush dev dummy0
ip link set dummy0 down
ip addr add 192.168.1.7/24 dev dummy0
ip addr add 192.168.1.8/24 dev dummy0
ip link set dummy0 up
sudo vtysh -c 'show ip route' | grep dummy0
Signed-off-by: Volodymyr Huti volodymyr.huti@gmail.com
Fixes #10160