From patchwork Sun Dec 22 06:02:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "A. Wilcox" X-Patchwork-Id: 1214617 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=Wilcox-Tech.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 47gXCf2HkTz9sR0 for ; Sun, 22 Dec 2019 17:10:38 +1100 (AEDT) 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 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 {