From nobody Fri May 10 14:37:55 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 4VbWh348xCz5JZXW; Fri, 10 May 2024 14:37:55 +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 4VbWh33hz6z4lM8; Fri, 10 May 2024 14:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715351875; 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=R17DQcVusFWuzPWxsCKXVbwJWKNj2AvdwO75fBPyAzE=; b=HcIxoLxmi2ZFG8YH51atwKYTO4BoDr87A6/O8AF+Rfc1jL1wwG7vqRBuJUi+mD6Rv2dbdi PYXRK4J7Krx6ymHslfKUS/VwL7AtKvDs5fSES/zqr9JDI1L0e5bikOBYP+RuLgCWB2Eza/ RW0ZTOhhHVWK4nyEGZz9r+HQ2MulnYgPbQk+2QsvB3c+Jvrhe9RUNDpiOcf/Yis3JE3gLb oe2aJxdlIqfjv0vfVuFPerWbLu7X4aitrQ3nk518S2ZW7nC7273R878iI5Q4xt0zj1Pgh+ yOOawWIx5rs6NGzE4lBaivue60vodpsnHA89jE5OQwSjMeq1s58V1u82Tlqw1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715351875; a=rsa-sha256; cv=none; b=bdo24YAC6kTmC6WI3kxoq9/4ge8n8jvB+N0H1QIYWwbdnVzSgTkZWHNRkcavT+4cCKkQ+m 9P5XUZKJIV3yQIN8P5HOILFYRkz2MG+FGnt7XAqLKilxNRHAFyDVC4w4s2wABIZnkxLbBT oRXjGDRjdZS0bhfUwbcIVG4msMrfCt2ACamSj1wCZVdG1rS+Zho0VgfTwbu4V0g3mFcYyd F/CRcrTOgU/8dZH9IoqjZP5dNujVEiwvOUwBuB0VWI69IlZJlOTbbPoTwwwaiUvy2BVwY+ 6MiXLHeoN3us1muFFY53H/nUojRCdl/dnYguQ1komVaneACcCcw5yQgvNA+JNg== 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=1715351875; 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=R17DQcVusFWuzPWxsCKXVbwJWKNj2AvdwO75fBPyAzE=; b=vcyMR7NSCppVlqRNAardb9Jeekqpa9SkvxSyXaCdJ5f2IToWsvlGRew7PXdmFYBhqZ5b3G BIqcbuORuip9tgmohBI0ZD8sdByWnKeFMWXO04P1EFLr+U8vKiupXmF3W9Z3dyycd+IU/8 ro06PL+okVeIinyGD9X9k+X/Wpgp6W6uqyw1t7137GZEhkA4Vcf4T3vU7yY7iMwclkiWJM 6A6jkilfBdb7xuByeys5TBdrjmZ5b0fujU9U3GpccU+EHyYRNHHPjuEVoC2K1vpiCnX5bj nsQVH/fMk2I93nljXEDFQKwYEU/AYAuOJX+Nz6ML8KZu9Jq1JKKNi6KhZ70qHg== 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 4VbWh33Dz6zhG9; Fri, 10 May 2024 14:37:55 +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 44AEbthg004170; Fri, 10 May 2024 14:37:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AEbtbZ004167; Fri, 10 May 2024 14:37:55 GMT (envelope-from git) Date: Fri, 10 May 2024 14:37:55 GMT Message-Id: <202405101437.44AEbtbZ004167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: a5a2e963f9a0 - stable/14 - in6.h: expose s6_addr* definitions to user level 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: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a5a2e963f9a0a4bc65aa1c70a361243328e23961 Auto-Submitted: auto-generated The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=a5a2e963f9a0a4bc65aa1c70a361243328e23961 commit a5a2e963f9a0a4bc65aa1c70a361243328e23961 Author: Mike Karels AuthorDate: 2024-05-02 15:24:37 +0000 Commit: Mike Karels CommitDate: 2024-05-10 14:37:43 +0000 in6.h: expose s6_addr* definitions to user level The only element of of in6_addr that is specified in RFC 3493 or in POSIX.1-2017 is s6_addr, implemented via a #define to a union member. However, FreeBSD and other BSD systems have additional definitions for the other union members, s6_addr{8,16,32} which are defined for the kernel and loader. Some Linux applications also use them, and they seem to be allowed by the RFC and POSIX. Remove the current ifdefs, exposing the additional fields to user level, and replace with #if __BSD_VISIBLE. Add an explanatory comment expanding on the previous "nonstandard" comment. Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D44979 (cherry picked from commit eb3dbf2dbe22ed6d4df54aebbf23f5b555a21cf1) --- sys/netinet6/in6.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 78c9cd56ed60..ce3bbea6b8e6 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -102,7 +102,13 @@ struct in6_addr { }; #define s6_addr __u6_addr.__u6_addr8 -#if defined(_KERNEL) || defined(_STANDALONE) /* XXX nonstandard */ +#if __BSD_VISIBLE +/* + * s6_addr is the only in6_addr element specified in RFCs 2553 and 3493, + * also in POSIX 1003.1-2017. The following three definitions were not + * exposed to user programs in FreeBSD before 14.1, or in other BSDs, + * and are thus less portable than s6_addr. + */ #define s6_addr8 __u6_addr.__u6_addr8 #define s6_addr16 __u6_addr.__u6_addr16 #define s6_addr32 __u6_addr.__u6_addr32