From nobody Thu May 02 15:25:33 2024 X-Original-To: dev-commits-src-main@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 4VVd6k1HMGz5JW1V; Thu, 2 May 2024 15:25:34 +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 4VVd6k0QM1z4Q8T; Thu, 2 May 2024 15:25:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714663534; 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=uubC/S1C52CYTGOPyyujU1Z0P5YyXZvzL9hLoKO9Yn0=; b=dhGsPuoNWY/UQnqQA2gBd+CJhUViR5y4oAbmvgopuB838FZJTjALPnSMdB7bWADgdTGYlY RH571zDHXb7mj15WQZYQhHzeu9g4VAWbJMxmYhYpVV3Lt6S1Ql3wzH+wl6pXJHqZF2AYl5 L2hVBuhhS46V2Lw2eZjC81XCRSduRY/Ef6bcs7LOsLZZ4bacNAY/LJwUgWZMzNj4k3jakw l5UddlhrsUj6FG6NFuB7WEEWpuoNYU8LklLYZnw4FLCpiMDYynjNfrSzA0UpBvM7/RWclS G859vmd6rIC/w2T8IPKhXlBI5dbK04p3QzirfSl85omhLNmI0wQyi55vd3zseg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714663534; a=rsa-sha256; cv=none; b=tg9e7DCHEcPEFIgo3XoTTj7eG2JPUmFhFW5BJ96tOkzUbm8qwjwCnv/L6CGcwF1FL2vBz5 +LbqnMRoVfjCgHiY24nwZLif+tBs1lOL7cqBd0tbsjamLBMA2+3r5abLK0DP6bPvUMGgrs deKBFz+aH4/AqN7AtXw4LZD+SE8Jb7ETtvBIDvHQ4gP3f/Y4atWqNKIRybQ0UGCuk3pmf5 1FL9Vd0amCjcfSIG2j9CiZDvElFpB9Lp0Hnl3ssmy/VTTYIDYjUzp445XEamI2/bdXMSpo FyZc18KxssJPB4QbIubyCTrrS64hiBNjCzciHX79zAtJhLmeObLWA1kD3Bb0YA== 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=1714663534; 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=uubC/S1C52CYTGOPyyujU1Z0P5YyXZvzL9hLoKO9Yn0=; b=WenR46/UgBgyPULx2BsQxV0FWxBXbmXXYmnowzNJxWmAijEPjsIvbQJYt9/hyNFQqSr11D qR1ox0EnyDTOg4VB6PVzvgN43b6tf1d6slHrqNlK5/rNuyrHo4urxtUWL9NcDIGWF/Z9jl JU4P/r9UcvowaaZCiNerYgphb1GqTmTvyAYA8Af6mM6J+9O8KV1588tNxeSVlUuwKDoMYB EwdoYXL7xpYMAO616168P0PWZxHg1k4v1Hn0nj8gvfo05XMuHboxwxhgfqfWerFhu55Eg3 wCdFZJJlFPbTbOLaGymxi7xOO96CyiRH5PbT0Kpnml/BYrB5wul3wXCYOoS+oQ== 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 4VVd6k0198z17Kc; Thu, 2 May 2024 15:25:34 +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 442FPXUD083017; Thu, 2 May 2024 15:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442FPXTp083014; Thu, 2 May 2024 15:25:33 GMT (envelope-from git) Date: Thu, 2 May 2024 15:25:33 GMT Message-Id: <202405021525.442FPXTp083014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: eb3dbf2dbe22 - main - in6.h: expose s6_addr* definitions to user level List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: eb3dbf2dbe22ed6d4df54aebbf23f5b555a21cf1 Auto-Submitted: auto-generated The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=eb3dbf2dbe22ed6d4df54aebbf23f5b555a21cf1 commit eb3dbf2dbe22ed6d4df54aebbf23f5b555a21cf1 Author: Mike Karels AuthorDate: 2024-05-02 15:24:37 +0000 Commit: Mike Karels CommitDate: 2024-05-02 15:24:37 +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. MFC after: 1 week Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D44979 --- 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 53a8fad106df..082e5f8990c9 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -100,7 +100,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