Skip to content

Commit

Permalink
bgpd: remove redundant loopback check in label update
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Loïc Sang committed Sep 4, 2024
1 parent 3ae49f7 commit d173522
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_mplsvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
label = bgp->vpn_policy[afi].tovpn_label;
}

Expand Down

0 comments on commit d173522

Please sign in to comment.