From nobody Tue May 14 20:01:59 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 4Vf6h805Ybz5KwJw; Tue, 14 May 2024 20:02:00 +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 4Vf6h71dX0z4FNC; Tue, 14 May 2024 20:01:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715716919; 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=1Fq9uKOTJeJC4/XeP/gbW4vhprG2TAcD+59cT8QgV3A=; b=fVDYshLaxyeVKyx3HoLBR4Gzdxq2RcEc/SLPe3WMdhKFG02jSO23fvrpB9wOZjWSOBBOrk ePWfeLxAhd0lqJgi5NihPd8TnKiwU5yTh0GjrV/Oeawb9qnp9XGYxIoodyJbHUt28UdPrB fqcGDSUgmyMn5slkqDR7FZZZNTuA0Vm8Ryokc5ZDHcQMkzt/iAtl4s6XZySfyX8jYlCkZg 9XkgdOgan9lKlvmZ/3JYsiK6XdfoQ3UcFF88uDPVaHKVDIEx+6pkCp2D9b3tkpdzxWjhvd eWFrIuE3C2bjWzLDp/H3T60on1S/lJdwuOW661CNhh1Df+M4KsBMYbqpKK0M3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715716919; a=rsa-sha256; cv=none; b=gp0uhaQ7/rtqWw0Tmor6wMqBxlZgJgcAYTm5q07813JvvGQTsyCiTc/6kv1kNMpbuvbHGl vzmIC1DGzwvRimDAqD0yphf0cHnjl0HgNPUTf0LF7ZMNsE5FHknw3fQv+FQRedWAZf+/R8 Xds1qLFb81a0s68StGuiz/WBHDmu1kF/yLba0UTPKHNggU7PjjzBe44Y3/hun0wi3EE7b/ ghnYD3F/uodrjhKEcMfvaKtif9b1XW51jE9czNMyuF5GTYQxVr5LB6wuSQiCYyGubnbz0A 4+DrAlYVqnXe2/IhpQaU0fcs0G7B9WNDzeZGSAWLEY37ZbaYmtnldRJ1D9p5LA== 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=1715716919; 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=1Fq9uKOTJeJC4/XeP/gbW4vhprG2TAcD+59cT8QgV3A=; b=Z3juYPLuVpjr9SFU6WWtSOREzrwiJvbSz0ciqlNltANwH+6Y1d53JxIJFarYpwfVdtcneb aimRJif6uDeT0Aqfsz4YZyJ3SQ3rHihPg5kq67hH/UlDdJGKkKoT3842Ihlq23+HDQZHas 9TVX40DxETCHpH0ui/FFP6qkHQjF4x4TgcLfq2h98515dV7Kpt+qohs9YsyQQYVXUyglRT WBoizzwvqvMu0iI331MLGbnSGUHeQDAoXR5ZajcAFuZU7+tSV4nRt3vQS49A7YBQ3ltRzf IYTzlv003P30AnHC3cCz6srpWQ7yUWrrXNG9tE9lqTNOHf28OeCeW55e+miwiw== 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 4Vf6h71Dxczlhv; Tue, 14 May 2024 20:01:59 +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 44EK1xO4038765; Tue, 14 May 2024 20:01:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44EK1xPh038762; Tue, 14 May 2024 20:01:59 GMT (envelope-from git) Date: Tue, 14 May 2024 20:01:59 GMT Message-Id: <202405142001.44EK1xPh038762@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: 096a438138b5 - releng/14.1 - 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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 096a438138b54d6e0bd657c626921b7c4eeea668 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=096a438138b54d6e0bd657c626921b7c4eeea668 commit 096a438138b54d6e0bd657c626921b7c4eeea668 Author: Mike Karels AuthorDate: 2024-05-02 15:24:37 +0000 Commit: Mike Karels CommitDate: 2024-05-14 20:01: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 Approved by: re (cperciva) (cherry picked from commit eb3dbf2dbe22ed6d4df54aebbf23f5b555a21cf1) (cherry picked from commit a5a2e963f9a0a4bc65aa1c70a361243328e23961) --- 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