Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2021 20:09:17 GMT
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b7fbdb5042c6 - releng/13.0 - Fix nexhtop group index array scaling.
Message-ID:  <202103312009.12VK9Hie034280@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.0 has been updated by melifaro:

URL: https://cgit.FreeBSD.org/src/commit/?id=b7fbdb5042c619221ee0b97573affcb8bcb59458

commit b7fbdb5042c619221ee0b97573affcb8bcb59458
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2021-03-29 23:00:17 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2021-03-31 20:00:10 +0000

    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>
    Approved by:    re (gjb)
    
    (cherry picked from commit 923e7f7e12670e97b097a195e69c848a6e8773a2)
---
 sys/net/route/nhgrp.c | 4 ++--
 1 file 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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103312009.12VK9Hie034280>