From nobody Fri Apr 12 16:58:15 2024 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 4VGN6w14r4z5HjgX; Fri, 12 Apr 2024 16:58: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 4VGN6v70Lpz40SH; Fri, 12 Apr 2024 16:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712941096; 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=YigEKWeIfQ4R8peXRQ9jFsLaTtCgi96AqqcYaBPF9KU=; b=ps8/rp439fGCsCG4WlCU+sX4ASSXm0kbnLMJgbUomybdMld/2gBpX0U9l+I7xnMySYg2K6 IHHTBtSZT997Eg1SZf96ct6iMJzUpOmlGOGRnpNZCPdgRtliqIZUe0XDrAJmjV9IcAXHHR 8JQwD1H3CIearR/zjhaHIussjAcs/Fmm0jJ6dgeB3RUjMwwQvKcg0WEBemsR8YLLEe6bWw 66F6QL8Sb9AI/dMhcW6FjPtdCBCMVFYzQOn//ODsH1sBCxIvNfVeIpolCt3zF/IrbuYO6y KJBPw3c1xSRZsOy9EQOLHJ8OylZ3ugzBjYb3hY3GUrd+xer+7/SRYadHJ0mgCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712941096; a=rsa-sha256; cv=none; b=IGHLfhfc6gjasRwKBqvQaHkbwg6qw9deCQ0DVIYl4PepQsV9NrD4URn1uYU41vXoxsTGx6 CH2CAP6o6L14QBUEgEsyoNGrFrWGa3XQJYBY51Pt2YHPpkTwI0PftTzz6LA3gxtMsjXw4f nVsxLc4f+V1oOzYf3d0/D5St+FS4El1zgJmhQJLci6lvi1p3+jPI6z2NLCoPYfZ6FIztdA zueSbcdyfQvP96lMQ+k6ND0D1pDRc1ub9Df4gv2pXCwVm4vxyVLH176lk2u6jZ/JEj4Mp1 yiYmFiFTEnmYYAS+53JiMT52awDYXRt093v/tE+u1649vxsmXIfvnjN57y9lwQ== 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=1712941096; 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=YigEKWeIfQ4R8peXRQ9jFsLaTtCgi96AqqcYaBPF9KU=; b=HsCQM5jPI/tdddOosPpXa4t6gTCSPXae3l5e/J8JcT5YT/ulgI0GLhXvvKVcw37qu6pn0H 1vldTF2yVZbfKqMUdpysxicRqItLHjMorgJaQ2vi154U4dhq1t3ybQMiFBi1SsllOjglTs /lskrCiHMh3ci0hkQf5/UkzywsBPCAyOlsy4iPqb2jKby3vazA5TIKRKCxo2OujidxvcyW 6P5woAw0HzBgmdmfNTwM1fRWe3R8WE7wpNW973+K5/K01T9a73+Z4Z9oxyqYYIGP8Mqd0m a9xtMFOC0Y45/pt1v1hjFq0T1DV0Fwpj1X6VUv3N2LonycugAX2bBurpjc1+vA== 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 4VGN6v6bWlzxJw; Fri, 12 Apr 2024 16:58:15 +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 43CGwFpO040969; Fri, 12 Apr 2024 16:58:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43CGwF6r040966; Fri, 12 Apr 2024 16:58:15 GMT (envelope-from git) Date: Fri, 12 Apr 2024 16:58:15 GMT Message-Id: <202404121658.43CGwF6r040966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 042fb58d009e - main - sys/netinet6/in6_pcb.c: fix compile without INET 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 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/main X-Git-Reftype: branch X-Git-Commit: 042fb58d009e7efc5b334b68fffbef9b1f620ec8 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=042fb58d009e7efc5b334b68fffbef9b1f620ec8 commit 042fb58d009e7efc5b334b68fffbef9b1f620ec8 Author: Lexi Winter AuthorDate: 2024-04-12 16:54:24 +0000 Commit: Warner Losh CommitDate: 2024-04-12 16:54:27 +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 --- 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 d18a7283ba05..e6ec0f24c898 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -544,13 +544,13 @@ in6_getpeeraddr(struct socket *so, struct sockaddr *sa) int in6_mapped_sockaddr(struct socket *so, struct sockaddr *sa) { - 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) { struct sockaddr_in sin; @@ -570,13 +570,13 @@ in6_mapped_sockaddr(struct socket *so, struct sockaddr *sa) int in6_mapped_peeraddr(struct socket *so, struct sockaddr *sa) { - 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) { struct sockaddr_in sin; @@ -585,8 +585,10 @@ in6_mapped_peeraddr(struct socket *so, struct sockaddr *sa) in6_sin_2_v4mapsin6(&sin, (struct sockaddr_in6 *)sa); } else #endif - /* scope issues will be handled in in6_getpeeraddr(). */ - error = in6_getpeeraddr(so, sa); + { + /* scope issues will be handled in in6_getpeeraddr(). */ + error = in6_getpeeraddr(so, sa); + } return error; }