diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-11-20 12:53:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-20 12:53:09 +0100 |
commit | 587cf8f170af8597dd68efefe79ef9886e95e0bb (patch) | |
tree | 440d5090e21527c7bbfaf038a3c31215f4fb0abe /isisd | |
parent | Merge pull request #10097 from pguibert6WIND/ipv6_fix_ecom_list (diff) | |
parent | ospfd: fix processing of ext prefix in SR (diff) | |
download | frr-587cf8f170af8597dd68efefe79ef9886e95e0bb.tar.xz frr-587cf8f170af8597dd68efefe79ef9886e95e0bb.zip |
Merge pull request #9683 from volta-networks/sr-minor-fixes
ospfd, isisd: minor SR fixes
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_sr.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index f7cef43d0..54e31f004 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -550,13 +550,13 @@ static void sr_local_block_delete(struct isis_area *area) */ static mpls_label_t sr_local_block_request_label(struct sr_local_block *srlb) { - mpls_label_t label; uint32_t index; uint32_t pos; + uint32_t size = srlb->end - srlb->start + 1; /* Check if we ran out of available labels */ - if (srlb->current >= srlb->end) + if (srlb->current >= size) return MPLS_INVALID_LABEL; /* Get first available label and mark it used */ @@ -568,7 +568,7 @@ static mpls_label_t sr_local_block_request_label(struct sr_local_block *srlb) /* Jump to the next free position */ srlb->current++; pos = srlb->current % SRLB_BLOCK_SIZE; - while (srlb->current < srlb->end) { + while (srlb->current < size) { if (pos == 0) index++; if (!((1ULL << pos) & srlb->used_mark[index])) @@ -579,6 +579,10 @@ static mpls_label_t sr_local_block_request_label(struct sr_local_block *srlb) } } + if (srlb->current == size) + zlog_warn( + "SR: Warning, SRLB is depleted and next label request will fail"); + return label; } |