diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2023-02-16 10:39:40 +0100 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-05-09 21:00:57 +0200 | 
| commit | 1c6aa043efb5f3c2632e59c4594536b318c51fdc (patch) | |
| tree | 0233764d311dd46925a4768b4c414f31e06fbc60 /bgpd/bgp_labelpool.c | |
| parent | 577be36a41be45d7e78d6e9a38211a9aa0732b29 (diff) | |
bgpd: use nexthop interface when adding LSP in BGP MPLSVPN
BGP MPLSVPN next hop label allocation was using only the next-hop
IP address. As MPLSVPN contexts rely on bnc contexts, the real
nexthop interface is known, and the LSP entry to enter can apply
to the specific interface. To illustrate, the BGP service is able
to handle the following two iproute2 commands:
 > ip -f mpls route add 105 via inet 192.0.2.45 dev r1-eth1
 > ip -f mpls route add 105 via inet 192.0.2.46 dev r1-eth2
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_labelpool.c')
| -rw-r--r-- | bgpd/bgp_labelpool.c | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/bgpd/bgp_labelpool.c b/bgpd/bgp_labelpool.c index 41d4eabe1f..c08589cb91 100644 --- a/bgpd/bgp_labelpool.c +++ b/bgpd/bgp_labelpool.c @@ -1606,10 +1606,14 @@ void bgp_label_per_nexthop_free(struct bgp_label_per_nexthop_cache *blnc)  {  	if (blnc->label != MPLS_INVALID_LABEL) {  		bgp_zebra_send_nexthop_label(ZEBRA_MPLS_LABELS_DELETE, -					     blnc->label, ZEBRA_LSP_BGP, +					     blnc->label, blnc->nh->ifindex, +					     blnc->nh->vrf_id, ZEBRA_LSP_BGP,  					     &blnc->nexthop);  		bgp_lp_release(LP_TYPE_NEXTHOP, blnc, blnc->label);  	}  	bgp_label_per_nexthop_cache_del(blnc->tree, blnc); +	if (blnc->nh) +		nexthop_free(blnc->nh); +	blnc->nh = NULL;  	XFREE(MTYPE_LABEL_PER_NEXTHOP_CACHE, blnc);  }  | 
