History

uapi/if_ether.h: prevent redefinition of struct ethhdr

Musl provides its own ethhdr struct definition. Add a guard to prevent its definition of the appropriate musl header has already been included. glibc does not implement this header, but when glibc will implement this they can just define __UAPI_DEF_ETHHDR 0 to make it work with the kernel.

Hauke Mehrtens committed 8 years ago

Commit 6926e041 parent 7bbfe002 files · +9 −0Browse files

Showing the changes to include/uapi/linux/if_ether.h (1 of 2 files). Show all

Unified · Split

include/uapi/linux/if_ether.h+3−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #define _UAPI_LINUX_IF_ETHER_H
2424
2525 #include <linux/types.h>
26+#include <linux/libc-compat.h>
2627
2728 /*
2829 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
@@ -149,11 +150,13 @@ · 120 unmodified lines
149150 * This is an Ethernet frame header.
150151 */
151152
153+#if __UAPI_DEF_ETHHDR
152154 struct ethhdr {
153155 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
154156 unsigned char h_source[ETH_ALEN]; /* source ether addr */
155157 __be16 h_proto; /* packet type ID field */
156158 } __attribute__((packed));
159+#endif
157160
158161
159162 #endif /* _UAPI_LINUX_IF_ETHER_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t