mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
Merge 5336a205e1
into 3dd4d417be
This commit is contained in:
commit
adacd46246
|
@ -1734,6 +1734,12 @@ bgp_label_per_nexthop_find(struct bgp_label_per_nexthop_cache_head *tree,
|
|||
|
||||
void bgp_label_per_nexthop_free(struct bgp_label_per_nexthop_cache *blnc)
|
||||
{
|
||||
if (blnc->allocation_in_progress) {
|
||||
blnc->allocation_in_progress = false;
|
||||
bgp_label_per_nexthop_cache_del(blnc->tree, blnc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (blnc->label != MPLS_INVALID_LABEL) {
|
||||
bgp_zebra_send_nexthop_label(ZEBRA_MPLS_LABELS_DELETE,
|
||||
blnc->label, blnc->nh->ifindex,
|
||||
|
|
|
@ -79,6 +79,8 @@ struct bgp_label_per_nexthop_cache {
|
|||
|
||||
/* Back pointer to the cache tree this entry belongs to. */
|
||||
struct bgp_label_per_nexthop_cache_head *tree;
|
||||
|
||||
bool allocation_in_progress;
|
||||
};
|
||||
|
||||
DECLARE_RBTREE_UNIQ(bgp_label_per_nexthop_cache,
|
||||
|
|
|
@ -1414,6 +1414,11 @@ static int bgp_mplsvpn_get_label_per_nexthop_cb(mpls_label_t label,
|
|||
*/
|
||||
blnc->label = MPLS_INVALID_LABEL;
|
||||
|
||||
if (!blnc->allocation_in_progress) {
|
||||
bgp_label_per_nexthop_free(blnc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (old_label == blnc->label)
|
||||
return 0; /* no change */
|
||||
|
||||
|
@ -1487,6 +1492,7 @@ _vpn_leak_from_vrf_get_per_nexthop_label(struct bgp_path_info *pi,
|
|||
/* request a label to zebra for this nexthop
|
||||
* the response from zebra will trigger the callback
|
||||
*/
|
||||
blnc->allocation_in_progress = true;
|
||||
bgp_lp_get(LP_TYPE_NEXTHOP, blnc, from_bgp->vrf_id,
|
||||
bgp_mplsvpn_get_label_per_nexthop_cb);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue