From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F1E0C2D0C0 for ; Sun, 22 Dec 2019 06:10:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 733092070A for ; Sun, 22 Dec 2019 06:10:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725840AbfLVGKX (ORCPT ); Sun, 22 Dec 2019 01:10:23 -0500 Received: from mail.wilcox-tech.com ([45.32.83.9]:41172 "EHLO mail.wilcox-tech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbfLVGKX (ORCPT ); Sun, 22 Dec 2019 01:10:23 -0500 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Sun, 22 Dec 2019 01:10:23 EST Received: (qmail 5598 invoked from network); 22 Dec 2019 06:03:40 -0000 Received: from localhost (HELO gwyn.foxkit.us) (awilcox@wilcox-tech.com@127.0.0.1) by localhost with ESMTPA; 22 Dec 2019 06:03:40 -0000 From: "A. Wilcox" To: netdev@vger.kernel.org, linux-api@vger.kernel.org, musl@lists.openwall.com Cc: "A. Wilcox" 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> X-Mailer: git-send-email 2.22.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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