From nobody Fri Apr 17 22:58:47 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 4fy9Kg5cKgz6ZGX1 for ; Fri, 17 Apr 2026 22:58:47 +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 4fy9Kg3wb1z3SrQ for ; Fri, 17 Apr 2026 22:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466727; 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=dhETzXXvzneFXD5Y3WaoarqwWCKKyUbERlhMnHO+mbI=; b=C4XylgZh9B84SrJObKkA4XvZOgIcNVqnj2xn+jAuSkLAYSOcg+RGLAuVHEZU3TEWYRy1qQ a5B8/lywWKoVxyfLjKhr7uSgbZYBx3tfXfusrQQWUwvkp46gadoi92peiuGp4yIhhL0u6F r/VVEoDDZGQK4TRte1vVbcU/c4mu/xOuATI2tBKQc5AbASZnN7WOT3m2Rx+Y2xi2vaS5OJ M8XCaPkBqHZrHU98a/zdeeTYW7ur2OeTW1xz3NZjqbizYslWw35jWuEhklqE4WttzPFTiD qr8tw71eY4U85ztv8ZSxYu3kkxfX84BBbENt6HlnI6TAzEEC6OS51thE73cUYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466727; a=rsa-sha256; cv=none; b=LUuBaFCWfLeqOlBrGU4CZFkeSwehqfaSPZp0xfpdeX5NRl8XgWguajVBb+wXsWZEVq5IxP oDXneX060jK1OMjb2kSl2K++vWhdBHB7gHGyN98qCRppYlVLqDKQ2vjVvP9gsevqNZwdxI ojvIbaBaVpZ7P3N1bQPKzxxenruiKGzYCbcJeQVAF+OuKboJo3iJ/HqQURQjMYNZNoUrqm DH61PicBPl8l70usa/fUQ1Lfj/AIMa2sUL/ZC39pKAkoIv++tDf2WEVowXiiJO8Q9iptcc l/HDdWUSKBDSVZdlKNALjMnjGZ2dGzeWsWanB+yzcF6pqIWlOr/MoUSTsgAkgQ== 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=1776466727; 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=dhETzXXvzneFXD5Y3WaoarqwWCKKyUbERlhMnHO+mbI=; b=yMP0YNZSm6kHo31xZEP5nrShCJGFGMnaZhQDO8ySwCJjx9V8NP82O+AQOCJEvI24fEHcva hCgXLxJXNRo1BCrGRCOsQfGyMa2b95F/WuTtt6Wr35vZiUdtqAuax7bcXazzOx96yhJkKW 3fP1X0Pjy/S0VvYB1bRsScwTsy2pymt7XsUMfDPQTAQH9hiHQVKkE/udRdoIC4hZLhqDo4 0HHuM+79QJIvhAt+W0c8gIv7IR78AJS+u3B4IOJzVStaCvdVcQl7D9GQZ21f2MBknsAt9J sM0n147JLwrmximwHbNX03ndHV7R2YCGq5ok5HkkSIW6vjy9fKcAkNBJn1ZVaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kg3Tfxz1Bsk for ; Fri, 17 Apr 2026 22:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3908f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: d022dd82059b - main - nd6: Change prelist_update return type to void 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: d022dd82059b6173505377d47e3d0048906f8311 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:47 +0000 Message-Id: <69e2bb27.3908f.71752c21@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=d022dd82059b6173505377d47e3d0048906f8311 commit d022dd82059b6173505377d47e3d0048906f8311 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 22:20:47 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:17 +0000 nd6: Change prelist_update return type to void The return value of `prelist_update()` is unused. Reviewed by: markj, zlei Differential Revision: https://reviews.freebsd.org/D56132 --- sys/netinet6/nd6_rtr.c | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 5833bf487c23..339ae5ebbaea 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -89,7 +89,7 @@ struct nd_routectl { }; static struct nd_defrouter *defrtrlist_update(struct nd_defrouter *); -static int prelist_update(struct nd_prefixctl *, struct nd_defrouter *, +static void prelist_update(struct nd_prefixctl *, struct nd_defrouter *, bool, int); static int nd6_routelist_update(struct nd_routectl *); static int nd6_prefix_onlink(struct nd_prefix *); @@ -313,7 +313,7 @@ nd6_ra_opt_pi(struct nd_opt_hdr *pt, struct ifnet *ifp, pr.ndpr_plen = pi->nd_opt_pi_prefix_len; pr.ndpr_vltime = ntohl(pi->nd_opt_pi_valid_time); pr.ndpr_pltime = ntohl(pi->nd_opt_pi_preferred_time); - (void)prelist_update(&pr, dr, auth, mcast); + prelist_update(&pr, dr, auth, mcast); } static void @@ -1552,7 +1552,7 @@ nd6_prefix_update(struct nd_prefixctl *new, struct nd_prefix *pr) } } -static int +static void prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, bool auth, int mcast) { @@ -1572,9 +1572,9 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, nd6_prefix_update(new, pr); else { if (new->ndpr_vltime == 0) - goto end; + return; if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0) - goto end; + return; error = nd6_prelist_add(new, &pr); if (error != 0) { @@ -1582,7 +1582,8 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, "the prefix %s/%d on %s (errno=%d)\n", __func__, ip6_sprintf(ip6buf, &new->ndpr_prefix.sin6_addr), new->ndpr_plen, if_name(new->ndpr_ifp), error)); - goto end; /* we should just give up in this case. */ + /* we should just give up in this case. */ + return; } /* @@ -1602,24 +1603,16 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, pfxrtr_add(pr, dr); /* - * Address autoconfiguration based on Section 5.5.3 of RFC 2462. + * Address autoconfiguration based on Section 5.5.3 of RFC 4862. * Note that pr must be non NULL at this point. + * + * 5.5.3 (a). Ignore the prefix without the A bit set. + * 5.5.3 (b). the link-local prefix should have been ignored in nd6_ra_input. + * 5.5.3 (c). Consistency check on lifetimes: pltime <= vltime. */ - - /* 5.5.3 (a). Ignore the prefix without the A bit set. */ - if (!new->ndpr_raf_auto) - goto end; - - /* - * 5.5.3 (b). the link-local prefix should have been ignored in - * nd6_ra_input. - */ - - /* 5.5.3 (c). Consistency check on lifetimes: pltime <= vltime. */ - if (new->ndpr_pltime > new->ndpr_vltime) { - error = EINVAL; /* XXX: won't be used */ + if (new->ndpr_raf_auto == 0 || + new->ndpr_pltime > new->ndpr_vltime) goto end; - } /* * 5.5.3 (d). If the prefix advertised is not equal to the prefix of @@ -1628,12 +1621,12 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, * Lifetime is not 0, form an address. We first check if we have * a matching prefix. * Note: we apply a clarification in rfc2462bis-02 here. We only - * consider autoconfigured addresses while RFC2462 simply said + * consider autoconfigured addresses while RFC 4862 simply said * "address". */ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct in6_ifaddr *ifa6; - u_int32_t remaininglifetime; + uint32_t remaininglifetime; if (ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -1844,16 +1837,12 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, * XXX: what if address duplication happens? */ pfxlist_onlink_check(); - } else { - /* just set an error. do not bark here. */ - error = EADDRNOTAVAIL; /* XXX: might be unused. */ } } end: - if (pr != NULL) - nd6_prefix_rele(pr); - return (error); + nd6_prefix_rele(pr); + return; } /*