From nobody Thu Apr 30 22:07:50 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g67Zv142Bz6cMKL for ; Thu, 30 Apr 2026 22:07:51 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g67Zt5SmGz3kCT for ; Thu, 30 Apr 2026 22:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777586870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dg5m7AVZ+RqZQ7mMsJ/vRf/0rDPTPg7JDhzTqkQqVkA=; b=gSadVDrAFVrm6aYpj+YWGkkyEttJWQZF9WbZambxgYFq3dc9ZM6wDI8Mr3deCsXLQhWV/y 4F+KOc0aVX/ETf8v9pPI7sbNOC7yu76swUu1J+vsPklfQ4S8Ed9VaMDYLq+TR030TAKsjf 2R0e+60ao9IJjoQDnxFsctKUoLIO5gh87TRPsmLEzXEQtdu/kApzA4RrqxWdbSqTLz4B19 /Gudxu/E5I4A1qZR2pGefLubtwkB8LPnv7W/djaAl/pU+XbS22Sv7sGinqjjV+O1Rh9WPw WGvmCipA2XYCz6LSfkIha2Vfp4N8Iho1XzZFzdCA4tm8PVtkfE/DashYK35iOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777586870; a=rsa-sha256; cv=none; b=eRF5an7YU4H1/HsY/DEXZ/hzjTLCLlwz5PjsA0dKmPZf8XY6cFcnguMBqN40KP8GtuCvB9 F22wgsgZ59UVPqU/PKBnP1y8owuuFpkloJY8lxvgYuhxSIpqzpdZ8FLuaPXA6wQ9jC+3+U mPopfW+3IJhod4a8qPkam5SsiMEH6/UqaApiIXZ2D7HwEHtIMDuNz4iw3qpCpTr0ATLH/W AqqXFqXXqLEnsxvwii4MSqSBhoy1ZmGgocE7Vphagw26QC5gXU2PfNH2c5JDBiejYhlaKI kw1duKc46zhc522eJ45WlG9SOBBf2DbqHBJnTxR83wGD3Qpa5jirF0bU4h3ioQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777586870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dg5m7AVZ+RqZQ7mMsJ/vRf/0rDPTPg7JDhzTqkQqVkA=; b=p3ejsPPgyBcLg61ivzSsyG6GBMQcAsCLRhgtHLlqRJvThLSIcnFMH1zOunjSSfy5lgybOs qzENvJoAyKlZ35OIT1hBV/8ze3yW8CvV8jprymacePGCMxh0WRhZ7RBDT8Cq7hCCPrFwbe n7htPbP6O27Wvkreo44/ptrUO93xXHDi1vnPq77KvUzf730SupHBQ8X97pSkBO7f4slp4s uyM62eq7krbDYu3cAjRlKj6VuoB3bL6tPY7OCbKizApp5gHt5TMvKlIPfP0EhotNaVqIWg 5oXXsj4aq8Yv2xEsc+XB1rc/O2qC36ys2YvuQoaitU141yzZHQzSK8I8rzcykA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g67Zt50XHzTtR for ; Thu, 30 Apr 2026 22:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ce23 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 30 Apr 2026 22:07:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 8a64738f5a93 - main - routing: Expire nhops inside the nhgrp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a64738f5a93ea878425ee3f51e1b9efbd3f5d6e Auto-Submitted: auto-generated Date: Thu, 30 Apr 2026 22:07:50 +0000 Message-Id: <69f3d2b6.1ce23.a69ad9d@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=8a64738f5a93ea878425ee3f51e1b9efbd3f5d6e commit 8a64738f5a93ea878425ee3f51e1b9efbd3f5d6e Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-19 10:58:25 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-30 22:06:07 +0000 routing: Expire nhops inside the nhgrp Fix route expiration of nhops that exists inside a nhgrp. Differential Revision: https://reviews.freebsd.org/D56189 --- sys/net/route/route_ctl.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index fe00c762905d..7612c2bdfb58 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -1183,6 +1183,26 @@ change_route_byinfo(struct rib_head *rnh, struct rtentry *rt, return (error); } +static void +update_tmproutes_mpath(struct rib_head *rnh, struct rtentry *rt, + struct route_nhop_data *rnd) +{ + const struct weightened_nhop *wn; + uint32_t i, nhops; + + if (NH_IS_NHGRP(rnd->rnd_nhop)) { + wn = nhgrp_get_nhops(rnd->rnd_nhgrp, &nhops); + + for (i = 0; i < nhops; i++) { + if (nhop_get_expire(wn[i].nh) == 0) + continue; + + tmproutes_update(rnh, rt, wn[i].nh); + } + } else if (nhop_get_expire(rnd->rnd_nhop) != 0) + tmproutes_update(rnh, rt, rnd->rnd_nhop); +} + /* * Insert @rt with nhop data from @rnd_new to @rnh. * Returns 0 on success and stores operation results in @rc. @@ -1200,9 +1220,7 @@ add_route(struct rib_head *rnh, struct rtentry *rt, rn = rnh->rnh_addaddr(rt_key(rt), rt_mask_const(rt), &rnh->head, rt->rt_nodes); if (rn != NULL) { - if (!NH_IS_NHGRP(rnd->rnd_nhop) && nhop_get_expire(rnd->rnd_nhop)) - tmproutes_update(rnh, rt, rnd->rnd_nhop); - + update_tmproutes_mpath(rnh, rt, rnd); /* Finalize notification */ rib_bump_gen(rnh); rnh->rnh_prefixes++; @@ -1272,8 +1290,7 @@ change_route(struct rib_head *rnh, struct rtentry *rt, /* Changing nexthop & weight to a new one */ rt->rt_nhop = rnd->rnd_nhop; rt->rt_weight = rnd->rnd_weight; - if (!NH_IS_NHGRP(rnd->rnd_nhop) && nhop_get_expire(rnd->rnd_nhop)) - tmproutes_update(rnh, rt, rnd->rnd_nhop); + update_tmproutes_mpath(rnh, rt, rnd); /* Finalize notification */ rib_bump_gen(rnh);