summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-04-20 01:32:38 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-13 17:20:47 +0000
commit00eac4a8f8fd0561ce4a67c4f2e2205f9229b181 (patch)
tree17106168b8e109074fe3a6847e2966947a061d63 /src
parenta9a33884d271c7bc8824ddbe2dffbe517aa6b379 (diff)
vcl: expand vcl select maps in ldp if needed
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I56c487821233cebf2146745a4706cb573cc088a5 (cherry picked from commit cbce80aaa3f1853856d4d64c95f10d65caa4d786)
Diffstat (limited to 'src')
-rw-r--r--src/vcl/ldp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c
index af9742063fa..8bb512a5082 100644
--- a/src/vcl/ldp.c
+++ b/src/vcl/ldp.c
@@ -620,12 +620,13 @@ ldp_select_init_maps (fd_set * __restrict original,
if (vlsh == VLS_INVALID_HANDLE)
clib_bitmap_set_no_check (*libcb, fd, 1);
else
- clib_bitmap_set_no_check (*vclb, vlsh_to_session_index (vlsh), 1);
+ *vclb = clib_bitmap_set (*vclb, vlsh_to_session_index (vlsh), 1);
}));
/* *INDENT-ON* */
si_bits_set = clib_bitmap_last_set (*vclb) + 1;
*si_bits = (si_bits_set > *si_bits) ? si_bits_set : *si_bits;
+ clib_bitmap_validate (*resultb, *si_bits);
libc_bits_set = clib_bitmap_last_set (*libcb) + 1;
*libc_bits = (libc_bits_set > *libc_bits) ? libc_bits_set : *libc_bits;
@@ -756,15 +757,15 @@ ldp_pselect (int nfds, fd_set * __restrict readfds,
{
if (readfds)
clib_memcpy_fast (ldpw->rd_bitmap, ldpw->si_rd_bitmap,
- vec_len (ldpw->rd_bitmap) *
+ vec_len (ldpw->si_rd_bitmap) *
sizeof (clib_bitmap_t));
if (writefds)
clib_memcpy_fast (ldpw->wr_bitmap, ldpw->si_wr_bitmap,
- vec_len (ldpw->wr_bitmap) *
+ vec_len (ldpw->si_wr_bitmap) *
sizeof (clib_bitmap_t));
if (exceptfds)
clib_memcpy_fast (ldpw->ex_bitmap, ldpw->si_ex_bitmap,
- vec_len (ldpw->ex_bitmap) *
+ vec_len (ldpw->si_ex_bitmap) *
sizeof (clib_bitmap_t));
rv = vls_select (si_bits, readfds ? ldpw->rd_bitmap : NULL,