]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_labelpool.c
Merge branch 'master' into evpn-session-vrf
[mirror_frr.git] / bgpd / bgp_labelpool.c
index 7a7a400278ada435753ef474785558a62c28b0c6..69dd0f9daca6214d3302853e9415e93d4d6b264b 100644 (file)
@@ -180,14 +180,12 @@ static void lp_cbq_item_free(struct work_queue *wq, void *data)
 
 static void lp_lcb_free(void *goner)
 {
-       if (goner)
-               XFREE(MTYPE_BGP_LABEL_CB, goner);
+       XFREE(MTYPE_BGP_LABEL_CB, goner);
 }
 
 static void lp_chunk_free(void *goner)
 {
-       if (goner)
-               XFREE(MTYPE_BGP_LABEL_CHUNK, goner);
+       XFREE(MTYPE_BGP_LABEL_CHUNK, goner);
 }
 
 void bgp_lp_init(struct thread_master *master, struct labelpool *pool)
@@ -223,7 +221,7 @@ void bgp_lp_finish(void)
        skiplist_free(lp->inuse);
        lp->inuse = NULL;
 
-       list_delete_and_null(&lp->chunks);
+       list_delete(&lp->chunks);
 
        while ((lf = LABEL_FIFO_HEAD(lp->requests))) {
 
@@ -530,6 +528,7 @@ void bgp_lp_event_zebra_up(void)
        int chunks_needed;
        void *labelid;
        struct lp_lcb *lcb;
+       int lm_init_ok;
 
        /*
         * Get label chunk allocation request dispatched to zebra
@@ -541,6 +540,11 @@ void bgp_lp_event_zebra_up(void)
        chunks_needed = (labels_needed / LP_CHUNK_SIZE) + 1;
        labels_needed = chunks_needed * LP_CHUNK_SIZE;
 
+       lm_init_ok = lm_label_manager_connect(zclient, 1) == 0;
+
+       if (!lm_init_ok)
+               zlog_err("%s: label manager connection error", __func__);
+
        zclient_send_get_label_chunk(zclient, 0, labels_needed);
        lp->pending_count = labels_needed;