Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 544476 | Differences between
and this patch

Collapse All | Expand All

(-)a/include/uapi/linux/if_ether.h (-2 / +3 lines)
Lines 22-27 Link Here
22
#define _UAPI_LINUX_IF_ETHER_H
22
#define _UAPI_LINUX_IF_ETHER_H
23
23
24
#include <linux/types.h>
24
#include <linux/types.h>
25
#include <linux/libc-compat.h>
25
26
26
/*
27
/*
27
 *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
28
 *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
Lines 134-145 Link Here
134
/*
135
/*
135
 *	This is an Ethernet frame header.
136
 *	This is an Ethernet frame header.
136
 */
137
 */
137
138
#if __UAPI_DEF_ETHHDR
138
struct ethhdr {
139
struct ethhdr {
139
	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
140
	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
140
	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
141
	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
141
	__be16		h_proto;		/* packet type ID field	*/
142
	__be16		h_proto;		/* packet type ID field	*/
142
} __attribute__((packed));
143
} __attribute__((packed));
143
144
#endif
144
145
145
#endif /* _UAPI_LINUX_IF_ETHER_H */
146
#endif /* _UAPI_LINUX_IF_ETHER_H */
(-)a/include/uapi/linux/kernel.h (+2 lines)
Lines 1-7 Link Here
1
#ifndef _UAPI_LINUX_KERNEL_H
1
#ifndef _UAPI_LINUX_KERNEL_H
2
#define _UAPI_LINUX_KERNEL_H
2
#define _UAPI_LINUX_KERNEL_H
3
3
4
#ifdef __GLIBC__
4
#include <linux/sysinfo.h>
5
#include <linux/sysinfo.h>
6
#endif
5
7
6
/*
8
/*
7
 * 'kernel.h' contains some often-used function prototypes etc
9
 * 'kernel.h' contains some often-used function prototypes etc
(-)a/include/uapi/linux/libc-compat.h (-17 / +14 lines)
Lines 48-60 Link Here
48
#ifndef _UAPI_LIBC_COMPAT_H
48
#ifndef _UAPI_LIBC_COMPAT_H
49
#define _UAPI_LIBC_COMPAT_H
49
#define _UAPI_LIBC_COMPAT_H
50
50
51
/* We have included glibc headers... */
51
#ifndef __KERNEL__ /* we're used from userspace */
52
#if defined(__GLIBC__)
53
52
54
/* Coordinate with glibc netinet/in.h header. */
53
#ifdef _NETINET_IF_ETHER_H /* musl */
54
#define __UAPI_DEF_ETHHDR 0
55
#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */
56
#define __UAPI_DEF_ETHHDR 1
57
#endif
58
59
/* Coordinate with libc netinet/in.h header. */
55
#if defined(_NETINET_IN_H)
60
#if defined(_NETINET_IN_H)
56
61
57
/* GLIBC headers included first so don't define anything
62
/* libc headers included first so don't define anything
58
 * that would already be defined. */
63
 * that would already be defined. */
59
#define __UAPI_DEF_IN_ADDR		0
64
#define __UAPI_DEF_IN_ADDR		0
60
#define __UAPI_DEF_IN_IPPROTO		0
65
#define __UAPI_DEF_IN_IPPROTO		0
Lines 64-78 Link Here
64
#define __UAPI_DEF_IN_CLASS		0
69
#define __UAPI_DEF_IN_CLASS		0
65
70
66
#define __UAPI_DEF_IN6_ADDR		0
71
#define __UAPI_DEF_IN6_ADDR		0
67
/* The exception is the in6_addr macros which must be defined
68
 * if the glibc code didn't define them. This guard matches
69
 * the guard in glibc/inet/netinet/in.h which defines the
70
 * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
71
#if defined(__USE_MISC) || defined (__USE_GNU)
72
#define __UAPI_DEF_IN6_ADDR_ALT		0
72
#define __UAPI_DEF_IN6_ADDR_ALT		0
73
#else
74
#define __UAPI_DEF_IN6_ADDR_ALT		1
75
#endif
76
#define __UAPI_DEF_SOCKADDR_IN6		0
73
#define __UAPI_DEF_SOCKADDR_IN6		0
77
#define __UAPI_DEF_IPV6_MREQ		0
74
#define __UAPI_DEF_IPV6_MREQ		0
78
#define __UAPI_DEF_IPPROTO_V6		0
75
#define __UAPI_DEF_IPPROTO_V6		0
Lines 80-89 Link Here
80
#define __UAPI_DEF_IN6_PKTINFO		0
77
#define __UAPI_DEF_IN6_PKTINFO		0
81
#define __UAPI_DEF_IP6_MTUINFO		0
78
#define __UAPI_DEF_IP6_MTUINFO		0
82
79
83
#else
80
#else /* defined(_NETINET_IN_H) */
84
81
85
/* Linux headers included first, and we must define everything
82
/* Linux headers included first, and we must define everything
86
 * we need. The expectation is that glibc will check the
83
 * we need. The expectation is that libc will check the
87
 * __UAPI_DEF_* defines and adjust appropriately. */
84
 * __UAPI_DEF_* defines and adjust appropriately. */
88
#define __UAPI_DEF_IN_ADDR		1
85
#define __UAPI_DEF_IN_ADDR		1
89
#define __UAPI_DEF_IN_IPPROTO		1
86
#define __UAPI_DEF_IN_IPPROTO		1
Lines 93-99 Link Here
93
#define __UAPI_DEF_IN_CLASS		1
90
#define __UAPI_DEF_IN_CLASS		1
94
91
95
#define __UAPI_DEF_IN6_ADDR		1
92
#define __UAPI_DEF_IN6_ADDR		1
96
/* We unconditionally define the in6_addr macros and glibc must
93
/* We unconditionally define the in6_addr macros and libc must
97
 * coordinate. */
94
 * coordinate. */
98
#define __UAPI_DEF_IN6_ADDR_ALT		1
95
#define __UAPI_DEF_IN6_ADDR_ALT		1
99
#define __UAPI_DEF_SOCKADDR_IN6		1
96
#define __UAPI_DEF_SOCKADDR_IN6		1
Lines 115-121 Link Here
115
/* If we did not see any headers from any supported C libraries,
112
/* If we did not see any headers from any supported C libraries,
116
 * or we are being included in the kernel, then define everything
113
 * or we are being included in the kernel, then define everything
117
 * that we need. */
114
 * that we need. */
118
#else /* !defined(__GLIBC__) */
115
#else /* __KERNEL__ */
119
116
120
/* Definitions for in.h */
117
/* Definitions for in.h */
121
#define __UAPI_DEF_IN_ADDR		1
118
#define __UAPI_DEF_IN_ADDR		1
Lines 138-143 Link Here
138
/* Definitions for xattr.h */
135
/* Definitions for xattr.h */
139
#define __UAPI_DEF_XATTR		1
136
#define __UAPI_DEF_XATTR		1
140
137
141
#endif /* __GLIBC__ */
138
#endif /* __KERNEL__ */
142
139
143
#endif /* _UAPI_LIBC_COMPAT_H */
140
#endif /* _UAPI_LIBC_COMPAT_H */

Return to bug 544476