From owner-dev-commits-src-all@freebsd.org Tue Sep 7 21:13:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90BA666C8CB; Tue, 7 Sep 2021 21:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3yfS3DZHz4VXH; Tue, 7 Sep 2021 21:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D93219ABA; Tue, 7 Sep 2021 21:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCxc0024159; Tue, 7 Sep 2021 21:12:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCxaK024158; Tue, 7 Sep 2021 21:12:59 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:59 GMT Message-Id: <202109072112.187LCxaK024158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: e86f5d4fcba8 - stable/13 - routing: Disallow zero nexthop weights in nexthop groups. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e86f5d4fcba8baa6dd3539e595b199035426d262 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:13:05 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=e86f5d4fcba8baa6dd3539e595b199035426d262 commit e86f5d4fcba8baa6dd3539e595b199035426d262 Author: Alexander V. Chernikov AuthorDate: 2021-08-30 21:49:00 +0000 Commit: Alexander V. Chernikov 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); }