Skip to content
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

bgpd: remove redundant loopback check in label update #16743

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

lsang6WIND
Copy link

The "if_is_vrf" check is unnecessary because it’s already handled by "if_get_vrf_loopback". Additionally, it ignores the default loopback and could introduce potential bugs.

Fixes: 8b81f32 ("bgpd: fix label lost when vrf loopback comes back")

The "if_is_vrf" check is unnecessary because it’s already handled by
"if_get_vrf_loopback". Additionally, it ignores the default loopback and
could introduce potential bugs.

Fixes: 8b81f32 ("bgpd: fix label lost when vrf loopback comes back")
Signed-off-by: Loïc Sang <[email protected]>
@@ -304,7 +304,7 @@ void vpn_leak_zebra_vrf_label_update(struct bgp *bgp, afi_t afi)

if (vpn_leak_to_vpn_active(bgp, afi, NULL, false)) {
ifp = if_get_vrf_loopback(bgp->vrf_id);
if (ifp && if_is_vrf(ifp) && if_is_up(ifp))
if (ifp && if_is_up(ifp))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if this is only a loopback, but not a VRF? if_get_vrf_loopback() can return true if this is only a loopback (default VRF).

Copy link
Author

@lsang6WIND lsang6WIND Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I observed a regression, the "import vpn" command fails to install the bgpd label on the default loopback interface. if_get_vrf_loopback() returns true for VRF and default loopback, the check if_is_vrf() is unnecessary and incorrect, as it ignores the default loopback.

@ton31337 ton31337 merged commit 4f185c5 into FRRouting:master Sep 4, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants