]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix zclient return code damage in labelpool
authorPat Ruddy <pat@voltanet.io>
Wed, 16 Dec 2020 15:06:30 +0000 (15:06 +0000)
committerPat Ruddy <pat@voltanet.io>
Mon, 4 Jan 2021 14:29:44 +0000 (14:29 +0000)
The check for the return code for zclient_send_get_label_chunk is
reversed and therefore the pending count does not get incremented
for each successful label chunk request.
This has the effect of requesting a 50 label chunk per label request
from BGP i.e we request 50 times the labels we require.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
bgpd/bgp_labelpool.c

index c5d8bbec3b3974423d43d31c94d0044fdbaa3edb..001340be3506b8b06ffbeb9ca18977bb023bdfb1 100644 (file)
@@ -394,7 +394,7 @@ void bgp_lp_get(
                        return;
                if (zclient_send_get_label_chunk(zclient, 0, LP_CHUNK_SIZE,
                                                 MPLS_LABEL_BASE_ANY)
-                   == ZCLIENT_SEND_FAILURE)
+                   != ZCLIENT_SEND_FAILURE)
                        lp->pending_count += LP_CHUNK_SIZE;
        }
 }