diff options
author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2021-03-29 23:00:17 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2021-03-29 23:00:17 +0000 |
commit | 9095dc7da4cf0c484fb1160b2180b7329b09b107 (patch) | |
tree | 144ade9e92c962646ae9b576452aa0cc72cd370d | |
parent | fdc9b2d50fe905b54afd773a2fc7fb9947508ddf (diff) | |
download | src-9095dc7da4cf0c484fb1160b2180b7329b09b107.tar.gz src-9095dc7da4cf0c484fb1160b2180b7329b09b107.zip |
Fix nexhtop group index array scaling.
The current code has the limit of 127 nexthop groups due to the
wrongly-checked bitmask_copy() return value.
PR: 254303
Reported by: Aleks <a.ivanov at veesp.com>
MFC after: 1 day
-rw-r--r-- | sys/net/route/nhgrp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/route/nhgrp.c b/sys/net/route/nhgrp.c index c25f4f09865b..f6638b12ebea 100644 --- a/sys/net/route/nhgrp.c +++ b/sys/net/route/nhgrp.c @@ -243,8 +243,8 @@ consider_resize(struct nh_control *ctl, uint32_t new_nh_buckets, uint32_t new_id CHT_SLIST_RESIZE(&ctl->gr_head, mpath, nh_ptr, new_nh_buckets); } if (nh_idx_ptr != NULL) { - if (bitmask_copy(&ctl->gr_idx_head, nh_idx_ptr, new_idx_items)) - bitmask_swap(&ctl->nh_idx_head, nh_idx_ptr, new_idx_items, &old_idx_ptr); + if (bitmask_copy(&ctl->gr_idx_head, nh_idx_ptr, new_idx_items) == 0) + bitmask_swap(&ctl->gr_idx_head, nh_idx_ptr, new_idx_items, &old_idx_ptr); } NHOPS_WUNLOCK(ctl); |