From 78b351ddcd96640e5a0aeb4c8e3baf65a0e67fc2 Mon Sep 17 00:00:00 2001 From: Pat Ruddy Date: Thu, 17 Dec 2020 10:49:30 +0000 Subject: [PATCH] bgpd: release label to labelpool on dereg when we de-register for a label associated with a prefix then release it back to the labelpool to clean up the stale reference held in the ledger and inuse lists. Signed-off-by: Pat Ruddy --- bgpd/bgp_label.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c index 4d39b8883..5a31bd024 100644 --- a/bgpd/bgp_label.c +++ b/bgpd/bgp_label.c @@ -277,8 +277,11 @@ void bgp_reg_dereg_for_label(struct bgp_dest *dest, struct bgp_path_info *pi, return; } } - } else + } else { UNSET_FLAG(dest->flags, BGP_NODE_LABEL_REQUESTED); + bgp_lp_release(LP_TYPE_BGP_LU, dest, + label_pton(&dest->local_label)); + } bgp_send_fec_register_label_msg( dest, reg, with_label_index ? pi->attr->label_index : 0);