From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/15051 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "A. Wilcox" Newsgroups: gmane.linux.lib.musl.general,gmane.linux.network,gmane.linux.kernel.api Subject: [PATCH] uapi: Prevent redefinition of struct iphdr Date: Sun, 22 Dec 2019 00:02:27 -0600 Message-ID: <20191222060227.7089-1-AWilcox@Wilcox-Tech.com> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="234952"; mail-complaints-to="usenet@blaine.gmane.org" Cc: "A. Wilcox" To: netdev@vger.kernel.org, linux-api@vger.kernel.org, musl@lists.openwall.com Original-X-From: musl-return-15067-gllmg-musl=m.gmane.org@lists.openwall.com Sun Dec 22 07:03:59 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iiuLO-000yzG-SK for gllmg-musl@m.gmane.org; Sun, 22 Dec 2019 07:03:58 +0100 Original-Received: (qmail 19814 invoked by uid 550); 22 Dec 2019 06:03:56 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 19782 invoked from network); 22 Dec 2019 06:03:55 -0000 X-Mailer: git-send-email 2.22.1 Xref: news.gmane.org gmane.linux.lib.musl.general:15051 gmane.linux.network:654138 gmane.linux.kernel.api:39088 Archived-At: As with struct ethhdr, the musl libc provides its own definition of the iphdr struct. This guard ensures software like net-tools builds correctly on the musl libc. The __UAPI_DEF_IPHDR definition is in ip.h itself to prevent the issue in commit da360299b673 ("uapi/if_ether.h: move __UAPI_DEF_ETHHDR libc define") from being seen here. Signed-off-by: A. Wilcox --- include/uapi/linux/ip.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h index e42d13b55cf3..d34a0d295672 100644 --- a/include/uapi/linux/ip.h +++ b/include/uapi/linux/ip.h @@ -83,6 +83,13 @@ #define IPV4_BEET_PHMAXLEN 8 +/* Allow libcs to deactivate this - musl has its own copy in */ + +#ifndef __UAPI_DEF_IPHDR +#define __UAPI_DEF_IPHDR 1 +#endif + +#if __UAPI_DEF_IPHDR struct iphdr { #if defined(__LITTLE_ENDIAN_BITFIELD) __u8 ihl:4, @@ -104,6 +111,7 @@ struct iphdr { __be32 daddr; /*The options start here. */ }; +#endif struct ip_auth_hdr { -- 2.22.1