From nobody Fri Apr 17 22:58:46 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 4fy9Kf5Skbz6ZGc4 for ; Fri, 17 Apr 2026 22:58:46 +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 4fy9Kf3ymGz3Sj5 for ; Fri, 17 Apr 2026 22:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466726; 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=JdzHYVHDji7XIPRKHUQqDiMJ09P4fGv8gLxf6aN3Kzs=; b=jhfEIv6PYEGAdlFTzR7s4yb4mE2QlsI5ZRfXLUOgQoAWw0kRzZaRCbJ3d/0lnVlW31nIaU kWWaMebQ4RvjgVnbrZ8FQLZqoSjLOdboVrBDEynqCddBe9j3hvpAXCezxGEvu/VpTOWTW8 SR8Uu+IWpgHVfONrG/BZlI8j0pHGHXCJvZd+juZZcddFT13qDRoRylqcm8tMgwKDiltia5 guzuvESkgZv5mg3TukeS1Y++cRGHOmSWzDluZUce3CjoWkVG4mKoEVYghqRena+zvYM5gl kJtgzcEUs/Il0IOroLJs1gPkG1falypllkYErw7YQhx1CxPLRnAaTQJUOqW4jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466726; a=rsa-sha256; cv=none; b=TeYnzQiTdFe2yRojufoR/WphSCLsMoDnJNWgK6A2gt4r2maCv3NEANNQpPGJTbPlz9AD2b 0kX5Px0YLGPgKVEcNZzG1CrpntQtlk3o9FnCyauNNTf2VQEmXIbHKEd4K/c4Cqrm+ywIDN y8CZiZGmCaJnt+AfhR808D9rMorM0PJnb8f1WKL2Wx+WKDydkZKkYeozPBUH46istHghX2 kUxY4hKdQBahgynQpERRi/SQxSP/TpebTXdCXHQrx3kmmNpVxUnipBVgp6ZOExGjoGuMA+ q9yNlTqlkF7aAN0n2oV4P7rHgN0TM41REjImsDtFQBi4c3r2khgntqSScLXKYA== 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=1776466726; 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=JdzHYVHDji7XIPRKHUQqDiMJ09P4fGv8gLxf6aN3Kzs=; b=eWQLbGjIcBMB39yuttYVnXgzfQz+J4+2ezSHj8/AbxCqsWvpBjn3GxZlIJbhAbNtXFmnqt wrAIrMo8OQdDCeCb/d/7guPcgNM4vX+ICViLrK/BBkEOqgg8Ai4EwglzH5r/yO74T72+94 CKTVeFphWoSkUXpobnMNsAb2LkDIJHPrXXb9wIPkqkrKt+eqjIxgB63letLA0STLjihF6h 8fPC/CjGteqyjE76mfL+579JXt6sxfYicj+GiJONdrWocUmECuLz+c04XNCzPt8iOy/zXL KDBbzrzjaJdZNy6XBPoSz/8kxC+jQvTxaSYPEymW+F43yHfMK4GCQMsTcQmixg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kf2hFpz1CGX for ; Fri, 17 Apr 2026 22:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39112 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: ced1de238fbe - main - nd6: Break pfxrtr_add out of nd6_prelist_add 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: ced1de238fbe620e2b110c34561d63656bd2043c Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:46 +0000 Message-Id: <69e2bb26.39112.75e65f90@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=ced1de238fbe620e2b110c34561d63656bd2043c commit ced1de238fbe620e2b110c34561d63656bd2043c Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 22:19:18 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:15 +0000 nd6: Break pfxrtr_add out of nd6_prelist_add Updating defrouter only required by `prelist_update()`. since `nd6_prelist_add()` is a public function, exclude unsed dr logic from it. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56131 --- sys/netinet6/in6.c | 2 +- sys/netinet6/in6_ifattach.c | 2 +- sys/netinet6/nd6.h | 3 +-- sys/netinet6/nd6_rtr.c | 15 ++++++--------- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index cf2720cac036..feb63bd0eaa4 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1319,7 +1319,7 @@ in6_addifaddr(struct ifnet *ifp, struct in6_aliasreq *ifra, struct in6_ifaddr *i * nd6_prelist_add will install the corresponding * interface route. */ - if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) { + if ((error = nd6_prelist_add(&pr0, &pr)) != 0) { if (carp_attached) (*carp_detach_p)(&ia->ia_ifa, false); goto out; diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 237fb7ecfd44..2f59b791a259 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -625,7 +625,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp) * valid with referring to the old link-local address. */ if ((pr = nd6_prefix_lookup(&pr0)) == NULL) { - if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) + if ((error = nd6_prelist_add(&pr0, &pr)) != 0) return (error); /* Reference prefix */ ia->ia6_ndpr = pr; diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 8dc27aef5e12..92b776b008b9 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -402,8 +402,7 @@ void nd6_defrouter_flush_all(void); void nd6_defrouter_purge(struct ifnet *); void nd6_defrouter_timer(void); void nd6_defrouter_init(void); -int nd6_prelist_add(struct nd_prefixctl *, struct nd_defrouter *, - struct nd_prefix **); +int nd6_prelist_add(struct nd_prefixctl *, struct nd_prefix **); void nd6_prefix_unlink(struct nd_prefix *, struct nd_prhead *); void nd6_prefix_del(struct nd_prefix *); void nd6_prefix_ref(struct nd_prefix *); diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 7b7db1b95e31..5833bf487c23 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1400,8 +1400,7 @@ nd6_prefix_rele(struct nd_prefix *pr) } int -nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr, - struct nd_prefix **newp) +nd6_prelist_add(struct nd_prefixctl *pr, struct nd_prefix **newp) { struct nd_prefix *new; char ip6buf[INET6_ADDRSTRLEN]; @@ -1448,8 +1447,6 @@ nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr, ND6_ONLINK_UNLOCK(); } - if (dr != NULL) - pfxrtr_add(new, dr); if (newp != NULL) *newp = new; return (0); @@ -1571,17 +1568,15 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, NET_EPOCH_ASSERT(); /* check if prefix already exists on the same interface */ - if ((pr = nd6_prefix_lookup(new)) != NULL) { + if ((pr = nd6_prefix_lookup(new)) != NULL) nd6_prefix_update(new, pr); - if (dr != NULL) - pfxrtr_add(pr, dr); - } else { + else { if (new->ndpr_vltime == 0) goto end; if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0) goto end; - error = nd6_prelist_add(new, dr, &pr); + error = nd6_prelist_add(new, &pr); if (error != 0) { nd6log((LOG_NOTICE, "%s: nd6_prelist_add() failed for " "the prefix %s/%d on %s (errno=%d)\n", __func__, @@ -1603,6 +1598,8 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, in6_init_prefix_ltimes(pr); } } + if (dr != NULL) + pfxrtr_add(pr, dr); /* * Address autoconfiguration based on Section 5.5.3 of RFC 2462.