Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2021 20:09:18 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: 0e7f02a1a996 - releng/13.0 - Zero `struct weightened_nhop` fields in nhgrp_get_addition_group().
Message-ID:  <202103312009.12VK9IWZ034303@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=0e7f02a1a996960895d7cf8a39a407bcdb43168c

commit 0e7f02a1a996960895d7cf8a39a407bcdb43168c
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2021-03-20 08:26:03 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2021-03-31 20:00:10 +0000

    Zero `struct weightened_nhop` fields in nhgrp_get_addition_group().
    
    `struct weightened_nhop` has spare 32bit between the fields due to
     the alignment (on amd64).
    Not zeroing these spare bits results in duplicating nhop groups
     in the kernel due to the way how comparison works.
    
    Approved by:    re (gjb)
    
    (cherry picked from commit 6f43c72b472ee78e04f1ebd347ca0ae7787ee876)
---
 sys/net/route/nhgrp_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c
index b329b907144f..b228c3bcee37 100644
--- a/sys/net/route/nhgrp_ctl.c
+++ b/sys/net/route/nhgrp_ctl.c
@@ -646,7 +646,7 @@ nhgrp_get_addition_group(struct rib_head *rh, struct route_nhop_data *rnd_orig,
 {
 	struct nh_control *ctl = rh->nh_control;
 	struct nhgrp_priv *nhg_priv;
-	struct weightened_nhop wn[2];
+	struct weightened_nhop wn[2] = {};
 	int error;
 
 	if (rnd_orig->rnd_nhop == NULL) {



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