From d173522bbfd7c5a2c01d706d23e3524f2e50beaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Sang?= Date: Tue, 3 Sep 2024 18:36:25 +0200 Subject: [PATCH] bgpd: remove redundant loopback check in label update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 8b81f32e9787 ("bgpd: fix label lost when vrf loopback comes back") Signed-off-by: Loïc Sang --- bgpd/bgp_mplsvpn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index f7ca51e14638..ad774b2b008c 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -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; }