From nobody Tue May 21 20:09:16 2024 X-Original-To: dev-commits-src-branches@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 4VkQWJ4d85z5M98G; Tue, 21 May 2024 20:09:16 +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 4VkQWJ3znlz4DbC; Tue, 21 May 2024 20:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322156; 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=fsjNkQ5WkujE2GT4CL2W1cOw3quOb3SsSiJwl4botuA=; b=K0niKoGtNK4eH80dN4PWrx4Cq3XikGIlW3NKG3VEuopi8MtbTvdOL4FvBxJMyFj3MHE16N Q7oD0mFFtP6JtmcMt0fMq3/QD75dTyqxhhNF5p+W2dSugZn7QLwGDvrzalitXScgXxa9xG WYRxRe16mgjOAM31JBp+zkiLOklGETJPr2tnlI8eS6TDIDJ8QyE1I/kzy2c/+4BoO7ezw4 ZwnpF7EDXP2kGhaBI+LJlCIY8jqdPi1zo4XMrfrjNuFiakzbwnA+JqbP4so1ukcXnLRUWh Jgev/GlSWFTaYRDUMwXwBovZVejSM2SMV9up/4mRoYht/5tki0epe9IefZkSmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322156; a=rsa-sha256; cv=none; b=dqFS2NUaFh4MRiOa6bGKqCFGe7BE5SAcqI+f75x6AjcQ/hS/w28vrh69mHi9KYkL81hRcK 8qLVfltssf4uijIDqtmAy2GLbdIytrJrd6jUvW5OIRs97ki93rLJdfT5NIymnBhIXafJV6 ZGfK/5giSu5n0Cc6rNUxp4aKPXBSVyhRZ4qVjME3HaJDdnGy3LcsyFJhXLfhxUEg/Q9rYz vpfw93TzwJvsqgYt8sJPqNbJnxqjXjss965OxfWBpvlBJYxaaqQszDxdsfS30ZaAzHh6hP WA1JUAv3YqeGZXlatOg68Qsf+qgyHFTIPS8t4wFOM6DFKGfOOVeBWqKZa+u9yQ== 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=1716322156; 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=fsjNkQ5WkujE2GT4CL2W1cOw3quOb3SsSiJwl4botuA=; b=AF5YPEQtCOhiT9aBW0Ipf5Q6slY6X6SgKqzBSc4U5CHnpiy5qJn0REfM7+jeQ7DK4YNw5y 4sc1Au2q0deKsu1Fl58HS2QqJpY5S5H+a5kim+nktQd1C3S5GiAf1iGOYJdWajB/Zweq4N YIc4xb71lIZYF+hvF7zGjvLPrGpEwpKDV4zPw89lQFNXRMC57ACQfBfU6/g/Ra1+wOgO1V vklmOC7HsSn1aGsNMpUx2O9VX7Gs4vDsQnzlZ30BjZuQ+AmPd3kvBSHLDDaojvzeq/3hxR /AHP/Xby5ZGVA6O02BcUHwRne43Zj9pmVSYLhYc0om9m9WHKMcLIli+t8vl17Q== 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 4VkQWJ3HNzzbtC; Tue, 21 May 2024 20:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9Gu0043748; Tue, 21 May 2024 20:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9GQ8043745; Tue, 21 May 2024 20:09:16 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:16 GMT Message-Id: <202405212009.44LK9GQ8043745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6df9fa1c6b83 - releng/14.1 - sys/netinet6/in6_pcb.c: fix compile without INET List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 6df9fa1c6b8391e09bf74195d302ab12286a1d8a Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6df9fa1c6b8391e09bf74195d302ab12286a1d8a commit 6df9fa1c6b8391e09bf74195d302ab12286a1d8a Author: Lexi Winter AuthorDate: 2024-04-12 16:54:24 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:08:41 +0000 sys/netinet6/in6_pcb.c: fix compile without INET in6_mapped_sockaddr() and in6_mapped_peeraddr() both define a local variable named 'inp', but in the non-INET case, this variable is set and never used, causing a compiler error: /src/freebsd/src/lf/sys/netinet6/in6_pcb.c:547:16: error: variable 'inp' set but not used [-Werror,-Wunused-but-set-variable] 547 | struct inpcb *inp; | ^ /src/freebsd/src/lf/sys/netinet6/in6_pcb.c:573:16: error: variable 'inp' set but not used [-Werror,-Wunused-but-set-variable] 573 | struct inpcb *inp; Fix this by guarding all the INET-specific logic, including the variable definition, behind #ifdef INET. While here, tweak formatting in in6_mapped_peeraddr() so both functions are the same. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1155 (cherry picked from commit 042fb58d009e7efc5b334b68fffbef9b1f620ec8) (cherry picked from commit f30c2d86c39f8c3090e1f8967c13f2dd0d5d664b) Approved-by: re (cperciva) --- sys/netinet6/in6_pcb.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 5c4ef7570ddc..90f91eef1daa 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -579,13 +579,13 @@ in6_getpeeraddr(struct socket *so, struct sockaddr **nam) int in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam) { - struct inpcb *inp; int error; +#ifdef INET + struct inpcb *inp; inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_mapped_sockaddr: inp == NULL")); -#ifdef INET if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_getsockaddr(so, nam); if (error == 0) @@ -603,21 +603,23 @@ in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam) int in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam) { - struct inpcb *inp; int error; +#ifdef INET + struct inpcb *inp; inp = sotoinpcb(so); KASSERT(inp != NULL, ("in6_mapped_peeraddr: inp == NULL")); -#ifdef INET if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_getpeeraddr(so, nam); if (error == 0) in6_sin_2_v4mapsin6_in_sock(nam); } else #endif - /* scope issues will be handled in in6_getpeeraddr(). */ - error = in6_getpeeraddr(so, nam); + { + /* scope issues will be handled in in6_getpeeraddr(). */ + error = in6_getpeeraddr(so, nam); + } return error; }