all: adjust imports to fix libc/linux headers
Linux headers and some libc headers have overlapping defines for network types and functions. In the past years, glibc and linux headers were improved to cooperate so you could include either one, in any order. With musl and possibly some older glibc versions that doesn't work so well. Reorder and change includes to make it work better. Yes, this looks pretty random and unmotivated. The includes are changed in order to successfully build on various libc/kernel versions, with the goal of not using #if.
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "nm-device.h"
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <signal.h>
|
||||
@@ -16,8 +15,10 @@
|
||||
#include <sys/wait.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/if_ether.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_addr.h>
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/if_infiniband.h>
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "nm-default.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <netinet/if_ether.h>
|
||||
#include <linux/if_tun.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
|
@@ -12,9 +12,10 @@
|
||||
#include <endian.h>
|
||||
#include <fcntl.h>
|
||||
#include <libudev.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <linux/fib_rules.h>
|
||||
#include <linux/ip.h>
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_bridge.h>
|
||||
#include <linux/if_link.h>
|
||||
#include <linux/if_tun.h>
|
||||
@@ -24,6 +25,7 @@
|
||||
#include <linux/tc_act/tc_mirred.h>
|
||||
#include <netinet/icmp6.h>
|
||||
#include <netinet/in.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <poll.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
|
Reference in New Issue
Block a user