]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: release label to labelpool on dereg
authorPat Ruddy <pat@voltanet.io>
Thu, 17 Dec 2020 10:49:30 +0000 (10:49 +0000)
committerPat Ruddy <pat@voltanet.io>
Mon, 4 Jan 2021 14:29:44 +0000 (14:29 +0000)
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 <pat@voltanet.io>
bgpd/bgp_label.c

index 4d39b888397c3d78173443bd6e26ee5632caf0c1..5a31bd0243ee9298f3a449a24530f1d24a4be07f 100644 (file)
@@ -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);