Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Sep 2021 21:12:59 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: e86f5d4fcba8 - stable/13 - routing: Disallow zero nexthop weights in nexthop groups.
Message-ID:  <202109072112.187LCxaK024158@gitrepo.freebsd.org>

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

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

commit e86f5d4fcba8baa6dd3539e595b199035426d262
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-07 21:02:59 +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
    
    (cherry picked from commit 0a3a377aee9bb28546fd2d1e45baa3fcad02439b)
---
 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 a686d1623053..33041f66b925 100644
--- a/sys/net/route/route_ctl.c
+++ b/sys/net/route/route_ctl.c
@@ -244,6 +244,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?202109072112.187LCxaK024158>