Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | From 2872f5d8bcef84e62b15b37ba4ffeccfb6402dad Mon Sep 17 00:00:00 2001 |
| 2 | From: rofl0r <retnyg@gmx.net> |
| 3 | Date: Wed, 22 Jan 2014 00:48:28 +0100 |
| 4 | Subject: [PATCH 1/3] libc-compat.h: fix some issues arising from in6.h |
| 5 | |
| 6 | namely redefinition of some structs provided by netinet/in.h. |
| 7 | --- |
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 9 | Upstream-Status: Submitted |
| 10 | |
| 11 | include/uapi/linux/libc-compat.h | 25 ++++++++----------------- |
| 12 | 1 file changed, 8 insertions(+), 17 deletions(-) |
| 13 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 14 | Index: linux-4.15/include/uapi/linux/libc-compat.h |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 15 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 16 | --- linux-4.15.orig/include/uapi/linux/libc-compat.h 2018-02-05 17:37:44.724314379 -0500 |
| 17 | +++ linux-4.15/include/uapi/linux/libc-compat.h 2018-02-05 17:38:02.148913820 -0500 |
| 18 | @@ -49,13 +49,12 @@ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 19 | #ifndef _UAPI_LIBC_COMPAT_H |
| 20 | #define _UAPI_LIBC_COMPAT_H |
| 21 | |
| 22 | -/* We have included glibc headers... */ |
| 23 | -#if defined(__GLIBC__) |
| 24 | +#ifndef __KERNEL__ /* we're used from userspace */ |
| 25 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 26 | -/* Coordinate with glibc net/if.h header. */ |
| 27 | -#if defined(_NET_IF_H) && defined(__USE_MISC) |
| 28 | +/* Coordinate with libc net/if.h header. */ |
| 29 | +#if defined(_NET_IF_H) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 30 | |
| 31 | -/* GLIBC headers included first so don't define anything |
| 32 | +/* LIBC headers included first so don't define anything |
| 33 | * that would already be defined. */ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 34 | |
| 35 | #define __UAPI_DEF_IF_IFCONF 0 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 36 | @@ -99,15 +98,7 @@ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 37 | #define __UAPI_DEF_IN_CLASS 0 |
| 38 | |
| 39 | #define __UAPI_DEF_IN6_ADDR 0 |
| 40 | -/* The exception is the in6_addr macros which must be defined |
| 41 | - * if the glibc code didn't define them. This guard matches |
| 42 | - * the guard in glibc/inet/netinet/in.h which defines the |
| 43 | - * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ |
| 44 | -#if defined(__USE_MISC) || defined (__USE_GNU) |
| 45 | #define __UAPI_DEF_IN6_ADDR_ALT 0 |
| 46 | -#else |
| 47 | -#define __UAPI_DEF_IN6_ADDR_ALT 1 |
| 48 | -#endif |
| 49 | #define __UAPI_DEF_SOCKADDR_IN6 0 |
| 50 | #define __UAPI_DEF_IPV6_MREQ 0 |
| 51 | #define __UAPI_DEF_IPPROTO_V6 0 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 52 | @@ -115,10 +106,10 @@ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 53 | #define __UAPI_DEF_IN6_PKTINFO 0 |
| 54 | #define __UAPI_DEF_IP6_MTUINFO 0 |
| 55 | |
| 56 | -#else |
| 57 | +#else /* defined(_NETINET_IN_H) */ |
| 58 | |
| 59 | /* Linux headers included first, and we must define everything |
| 60 | - * we need. The expectation is that glibc will check the |
| 61 | + * we need. The expectation is that libc will check the |
| 62 | * __UAPI_DEF_* defines and adjust appropriately. */ |
| 63 | #define __UAPI_DEF_IN_ADDR 1 |
| 64 | #define __UAPI_DEF_IN_IPPROTO 1 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 65 | @@ -128,7 +119,7 @@ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 66 | #define __UAPI_DEF_IN_CLASS 1 |
| 67 | |
| 68 | #define __UAPI_DEF_IN6_ADDR 1 |
| 69 | -/* We unconditionally define the in6_addr macros and glibc must |
| 70 | +/* We unconditionally define the in6_addr macros and libc must |
| 71 | * coordinate. */ |
| 72 | #define __UAPI_DEF_IN6_ADDR_ALT 1 |
| 73 | #define __UAPI_DEF_SOCKADDR_IN6 1 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 74 | @@ -170,7 +161,7 @@ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 75 | * or we are being included in the kernel, then define everything |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 76 | * that we need. Check for previous __UAPI_* definitions to give |
| 77 | * unsupported C libraries a way to opt out of any kernel definition. */ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 78 | -#else /* !defined(__GLIBC__) */ |
| 79 | +#else /* __KERNEL__ */ |
| 80 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 81 | /* Definitions for if.h */ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 82 | #ifndef __UAPI_DEF_IF_IFCONF |
| 83 | @@ -262,6 +253,6 @@ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 84 | #define __UAPI_DEF_XATTR 1 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 85 | #endif |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 86 | |
| 87 | -#endif /* __GLIBC__ */ |
| 88 | +#endif /* __KERNEL__ */ |
| 89 | |
| 90 | #endif /* _UAPI_LIBC_COMPAT_H */ |