From nobody Fri Apr 17 22:58:51 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 4fy9Km4zXfz6ZGPH for ; Fri, 17 Apr 2026 22:58:52 +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 4fy9Km02GXz3Sd0 for ; Fri, 17 Apr 2026 22:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466732; 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=sqkgNgzvHGQQaPfAiS7zYOBXKeuj6rqo/AffIR0Qpnk=; b=POa/CqSGJj/PWiRoV2iCvupqqUFddQO7GZmzBTjSJ3hDAhfE01c+GFxyy/sgr1FyV0qIOw HPxLa/JPw+1cX4kCfB1MOP88dWK8Tv4r89wNRW6m2aFLEFFmOri+PTEiPJJkmm7IuIZfiG TVN0TzK+5My/cGgmSdL/7YPf8R1G92SYkWdq7WuINplAQyZgLyyLaHezart6AGMkVVag95 4L6Wy8iVmB6KsbCZmgsmprvlUanaOoVimkXdy3vdr5yh6Gj0aHyFrgp+5JaucMLmABiDLd vSJifRTRlZlKvcSBZFLZieotMWPAPut8bSvlWpg+F8KKHychLiEiqTPKT+nVaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466732; a=rsa-sha256; cv=none; b=EKZYIEk7rntANfgy3hScem0dyo7GHJglOCQZUY67bKqwH5E/h8UZhA8ahSaohhLZ5tmcTI 0zOLmjjxr3EY1ODN8Xh/Rpga/Xp4A32zAI0/QZ6pkWOePxJuYgwZnKUuxR28sWa1ikGgLL FI8/1TRy7FURxTk0qsvBcbAeR15UkfTB9p41RfYp24SqsXn0ALRvbBJa7nYth37IyJuUdJ lBmPfJsEcWE+/yoi1G/Dq/378Eseoca1lPAp4W0kXqKJBKeXv/1rcUr6mAHKty92gH50Xf nXxemXkN/fQAFy2QCSnRL0SKZK1/X8d1umRiKk747wcb8v7NQRyjNFP/twrJgg== 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=1776466732; 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=sqkgNgzvHGQQaPfAiS7zYOBXKeuj6rqo/AffIR0Qpnk=; b=WhCOf7xB6z5TxkdZ5fTxvolli9rWiF1pJHkCUw4Ks2uxu6OUXZI7R1lT2fQtQ5Ta5Fu27b pjnQcAlqFjFWj/UqqjTjQUVl5uUy13CQPYGdBth+VRMTbjzAAXeATOVlRpmtzmckkEEwhM lVGXadNEpNyFraeUsGwvjpsQvSj/NH61u1lEkBjWc9EuTTGRiGo8qUQ39JH5SAZvOk7TRu QzWzfLRr9jQ5uJP57mY+li+hH2ZTr5UAiFAXsfh2xGjJpdZGt11Y9dJ/lzQLODPQRBE7uF LlgBIZL8f6kWUhdPv7tIiLDrDRVMtW7/E5C7xsyPFQoKCLy7NDViSI2nKURwKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kl6Sscz1CJK for ; Fri, 17 Apr 2026 22:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38d07 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 72043945c3c6 - main - nd6: Remove goto and unused condition in prelist_update 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: 72043945c3c6e924ac57ace76ec0a4447d05d905 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:51 +0000 Message-Id: <69e2bb2b.38d07.63bed8b7@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=72043945c3c6e924ac57ace76ec0a4447d05d905 commit 72043945c3c6e924ac57ace76ec0a4447d05d905 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-17 16:57:47 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:23 +0000 nd6: Remove goto and unused condition in prelist_update While here, style it. Reviewed by: markj, zlei Differential Revision: https://reviews.freebsd.org/D56136 --- sys/netinet6/nd6_rtr.c | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index e0ea36586985..637f00bef2c9 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1746,38 +1746,26 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, ia6_match = ia6; } - if (ia6_match == NULL && new->ndpr_vltime) { + /* + * 5.5.3 (d) (continued) + * If no address matched and the valid lifetime is non-zero, + * create a new address. + */ + if (ia6_match == NULL && new->ndpr_vltime != 0) { int ifidlen; - /* - * 5.5.3 (d) (continued) - * No address matched and the valid lifetime is non-zero. - * Create a new address. - */ - /* * Prefix Length check: * If the sum of the prefix length and interface identifier * length does not equal 128 bits, the Prefix Information * option MUST be ignored. The length of the interface - * identifier is defined in a separate link-type specific - * document. + * identifier is defined in a separate link-type specific document. */ ifidlen = in6_if2idlen(ifp); - if (ifidlen < 0) { - /* this should not happen, so we always log it. */ - log(LOG_ERR, "prelist_update: IFID undefined (%s)\n", - if_name(ifp)); - goto end; - } if (ifidlen + pr->ndpr_plen != 128) { - nd6log((LOG_INFO, - "%s: invalid prefixlen %d for %s, ignored\n", + nd6log((LOG_INFO, "%s: invalid prefixlen %d for %s, ignored\n", __func__, pr->ndpr_plen, if_name(ifp))); - goto end; - } - - if ((ia6 = in6_ifadd(new, mcast)) != NULL) { + } else if ((ia6 = in6_ifadd(new, mcast)) != NULL) { /* * note that we should use pr (not new) for reference. */ @@ -1789,8 +1777,7 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, * When a new public address is created as described * in RFC2462, also create a new temporary address. * - * RFC 3041 3.5. - * When an interface connects to a new link, a new + * 3.5: When an interface connects to a new link, a new * randomized interface identifier should be generated * immediately together with a new set of temporary * addresses. Thus, we specifiy 1 as the 2nd arg of @@ -1802,9 +1789,9 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, if (V_ip6_use_tempaddr && !has_temporary) { int e; if ((e = in6_tmpifadd(ia6, 1, 1)) != 0) { - nd6log((LOG_NOTICE, "%s: failed to " - "create a temporary address " - "(errno=%d)\n", __func__, e)); + nd6log((LOG_NOTICE, + "%s: failed to create a temporary address (errno=%d)\n", + __func__, e)); } } ifa_free(&ia6->ia_ifa); @@ -1818,9 +1805,7 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, } } -end: nd6_prefix_rele(pr); - return; } /*