Skip to content

Commit

Permalink
bgpd: fix bgp node created at withdraw event
Browse files Browse the repository at this point in the history
The prefixes unexportation triggers an attempt to create
the VPN prefix node if that prefix was not already present.

For instance, if a given prefix is not exported because of
a route-map filtering, the withdraw process will try to
create the node with the 'bgp_afi_node_get()' command.

Fix this by replacing this call by the 'bgp_safi_node_lookup()'
function.

Fixes: ddb5b48 ("bgpd: vpn-vrf route leaking")
Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Oct 9, 2023
1 parent 29fbfa8 commit 8d46bde
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bgpd/bgp_mplsvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,14 +1903,14 @@ void vpn_leak_from_vrf_withdraw(struct bgp *to_bgp, /* to */
return;
}

if (debug)
zlog_debug("%s: withdrawing (path_vrf=%p)", __func__, path_vrf);

bn = bgp_afi_node_get(to_bgp->rib[afi][safi], afi, safi, p,
&(from_bgp->vpn_policy[afi].tovpn_rd));
bn = bgp_safi_node_lookup(to_bgp->rib[afi][safi], safi, p,
&(from_bgp->vpn_policy[afi].tovpn_rd));

if (!bn)
return;
if (debug)
zlog_debug("%s: withdrawing (path_vrf=%p)", __func__, path_vrf);

/*
* vrf -> vpn
* match original bpi imported from
Expand Down

0 comments on commit 8d46bde

Please sign in to comment.