Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Sep 2021 07:19:34 GMT
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0a3a377aee9b - main - routing: Disallow zero nexthop weights in nexthop groups.
Message-ID:  <202109010719.1817JYpA049659@gitrepo.freebsd.org>

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

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

commit 0a3a377aee9bb28546fd2d1e45baa3fcad02439b
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2021-08-30 21:49:00 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2021-09-01 07:16:24 +0000

    routing: Disallow zero nexthop weights in nexthop groups.
    
    Adding such nexthops breaks calc_min_mpath_slots() assumptions,
     thus resulting in the incorrect nexthop group creation and
     eventually leading to panic.
    Reported by:    avg
    MFC after:      1 week
---
 sys/net/route/route_ctl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c
index 6db088102cd3..dc40b6b8de71 100644
--- a/sys/net/route/route_ctl.c
+++ b/sys/net/route/route_ctl.c
@@ -266,6 +266,8 @@ get_info_weight(const struct rt_addrinfo *info, uint32_t default_weight)
 	/* Keep upper 1 byte for adm distance purposes */
 	if (weight > RT_MAX_WEIGHT)
 		weight = RT_MAX_WEIGHT;
+	else if (weight == 0)
+		weight = default_weight;
 
 	return (weight);
 }



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