From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755164AbcHVS7b (ORCPT ); Mon, 22 Aug 2016 14:59:31 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:35722 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754126AbcHVS71 (ORCPT ); Mon, 22 Aug 2016 14:59:27 -0400 From: Mikko Rapeli To: linux-kernel@vger.kernel.org Cc: Mikko Rapeli , "David S. Miller" , Nicolas Dichtel Subject: [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix Date: Mon, 22 Aug 2016 20:33:29 +0200 Message-Id: <1471890809-4383-73-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a02:8070:d18f:5c00:bc6b:5a80:6b8d:855c X-SA-Exim-Mail-From: mikko.rapeli@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes this userspace compile error when net/route.h is included before linux/route.h: linux/route.h:30:8: error: redefinition of ‘struct rtentry’ Signed-off-by: Mikko Rapeli --- include/uapi/linux/libc-compat.h | 10 ++++++++++ include/uapi/linux/route.h | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h index 07a3462..16ba7dc 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h @@ -230,6 +230,13 @@ #endif /* defined(_NETROSE_ROSE_H) */ +/* Coordinate with glibc net/route.h */ +#if defined(_NET_ROUTE_H) +#define __UAPI_DEF_RTENTRY 0 +#else /* defined(_NET_ROUTE_H) */ +#define __UAPI_DEF_RTENTRY 1 +#endif /* defined(_NET_ROUTE_H) */ + /* Coordinate with glibc pty.h */ #if defined(_PTY_H) #define __UAPI_DEF_TERMIOS 0 @@ -369,6 +376,9 @@ #define __UAPI_DEF_ROSE_CAUSE_STRUCT 1 #define __UAPI_DEF_ROSE_FACILITIES_STRUCT 1 +/* Definitions for route.h */ +#define __UAPI_DEF_RTENTRY 1 + /* Definitions for time.h */ #define __UAPI_DEF_TIMESPEC 1 #define __UAPI_DEF_TIMEVAL 1 diff --git a/include/uapi/linux/route.h b/include/uapi/linux/route.h index 6600708..7b77ef2 100644 --- a/include/uapi/linux/route.h +++ b/include/uapi/linux/route.h @@ -23,10 +23,12 @@ #ifndef _LINUX_ROUTE_H #define _LINUX_ROUTE_H +#include #include #include /* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */ +#if __UAPI_DEF_RTENTRY struct rtentry { unsigned long rt_pad1; struct sockaddr rt_dst; /* target address */ @@ -45,7 +47,7 @@ struct rtentry { unsigned long rt_window; /* Window clamping */ unsigned short rt_irtt; /* Initial RTT */ }; - +#endif /* __UAPI_DEF_RTENTRY */ #define RTF_UP 0x0001 /* route usable */ #define RTF_GATEWAY 0x0002 /* destination is a gateway */ -- 2.8.1