From patchwork Mon Aug 22 18:33:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 662050 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3sJjQL4Rlmz9sxN for ; Wed, 24 Aug 2016 06:55:54 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755943AbcHWUzu (ORCPT ); Tue, 23 Aug 2016 16:55:50 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:48294 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753971AbcHWUzt (ORCPT ); Tue, 23 Aug 2016 16:55:49 -0400 Received: from lakka.kapsi.fi ([2001:1bc8:1004::1] ident=Debian-exim) by mail.kapsi.fi with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1bcIjb-00051F-G2 for netdev@vger.kernel.org; Tue, 23 Aug 2016 23:55:47 +0300 Received: from mcfrisk by lakka.kapsi.fi with local (Exim 4.84_2) (envelope-from ) id 1bcIjb-0008J7-Ek for netdev@vger.kernel.org; Tue, 23 Aug 2016 23:55:47 +0300 Received: from nyssemenee.iki.fi ([195.140.195.196]) by mail.kapsi.fi with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1bbuRl-0004ea-HC for mcfrisk@kapsi.fi; Mon, 22 Aug 2016 21:59:45 +0300 Received: from nyssetulee.iki.fi (nyssetulee.iki.fi [195.140.195.194]) by nyssemenee.iki.fi (8.15.2/8.15.2) with ESMTPS id u7MIxjbI012914 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 22 Aug 2016 21:59:45 +0300 (EEST) Received: from mail.kapsi.fi (mx1.kapsi.fi [IPv6:2001:1bc8:1004:0:0:0:1:25] (may be forged)) by nyssetulee.iki.fi (8.15.2/8.15.2) with ESMTPS id u7MIxiRS019237 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 22 Aug 2016 21:59:45 +0300 (EEST) Received: from [2a02:8070:d18f:5c00:bc6b:5a80:6b8d:855c] (helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1bbu7e-0004Ss-G7; Mon, 22 Aug 2016 21:38:58 +0300 From: Mikko Rapeli To: linux-kernel@vger.kernel.org Cc: Mikko Rapeli , "David S. Miller" , Eric Dumazet , Nicolas Dichtel Date: Mon, 22 Aug 2016 20:33:23 +0200 Message-Id: <1471890809-4383-67-git-send-email-mikko.rapeli@iki.fi> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi> References: <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi> MIME-Version: 1.0 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,SPF_NEUTRAL autolearn=ham version=3.3.2 Subject: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes X-UID: 141755 X-SA-Exim-Connect-IP: 2001:1bc8:1004::1 X-SA-Exim-Mail-From: mikko.rapeli@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fixes this userspace compile error when glibc netinet/ip_icmp.h is included before linux/icmp.h: linux/icmp.h:68:8: error: redefinition of ‘struct icmphdr’ Signed-off-by: Mikko Rapeli --- include/uapi/linux/icmp.h | 4 +++- include/uapi/linux/libc-compat.h | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/icmp.h b/include/uapi/linux/icmp.h index fddd9d7..cd38005 100644 --- a/include/uapi/linux/icmp.h +++ b/include/uapi/linux/icmp.h @@ -17,6 +17,7 @@ #ifndef _UAPI_LINUX_ICMP_H #define _UAPI_LINUX_ICMP_H +#include #include #define ICMP_ECHOREPLY 0 /* Echo Reply */ @@ -64,7 +65,7 @@ #define ICMP_EXC_TTL 0 /* TTL count exceeded */ #define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */ - +#if __UAPI_DEF_ICMPHDR struct icmphdr { __u8 type; __u8 code; @@ -82,6 +83,7 @@ struct icmphdr { __u8 reserved[4]; } un; }; +#endif /* __UAPI_DEF_ICMPHDR */ /* diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h index 40190a4..8a5a7cc 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h @@ -154,6 +154,13 @@ #endif /* _NETINET_IN_H */ +/* Coordinate with glibc netinet/ip_icmp.h header. */ +#if defined(__NETINET_IP_ICMP_H) +#define __UAPI_DEF_ICMPHDR 0 +#else /* defined(__NETINET_IP_ICMP_H) */ +#define __UAPI_DEF_ICMPHDR 1 +#endif /* defined(__NETINET_IP_ICMP_H) */ + /* Coordinate with glibc netipx/ipx.h header. */ #if defined(__NETIPX_IPX_H) @@ -218,6 +225,9 @@ #define __UAPI_DEF_IN6_PKTINFO 1 #define __UAPI_DEF_IP6_MTUINFO 1 +/* Definitions for icmp.h */ +#define __UAPI_DEF_ICMPHDR 1 + /* Definitions for ipx.h */ #define __UAPI_DEF_SOCKADDR_IPX 1 #define __UAPI_DEF_IPX_ROUTE_DEFINITION 1