diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-12-29 22:04:16 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-12-29 22:05:57 +0100 |
| commit | 35e3f847cfd8b50b97ed3172577d884b0869b18e (patch) | |
| tree | e1948c04771783a352e36800f8d214e51f796eaf /executor/common_linux.h | |
| parent | 204cb1446fa9aee09a506bc33f8fe605dbf709d2 (diff) | |
executor: fix linux includes
Builds in one distro, but another says:
In file included from <stdin>:39:0:
/usr/powerpc64le-linux-gnu/include/linux/if.h:143:8: error: redefinition of ‘struct ifmap’
/usr/powerpc64le-linux-gnu/include/net/if.h:111:8: note: originally defined here
Mess. Try to fix it.
Not sure what's the right solution and it it even exists.
Diffstat (limited to 'executor/common_linux.h')
| -rw-r--r-- | executor/common_linux.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index d49e99364..608dc964c 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -112,7 +112,6 @@ static bool write_file(const char* file, const char* what, ...) #include <sys/socket.h> #include <sys/types.h> -#include <linux/if.h> #include <linux/if_addr.h> #include <linux/if_link.h> #include <linux/in6.h> @@ -313,13 +312,13 @@ static void netlink_add_neigh(int sock, const char* name, #include <arpa/inet.h> #include <errno.h> #include <fcntl.h> +#include <net/if.h> #include <net/if_arp.h> #include <stdarg.h> #include <stdbool.h> #include <sys/ioctl.h> #include <sys/stat.h> -#include <linux/if.h> #include <linux/if_ether.h> #include <linux/if_tun.h> #include <linux/ip.h> @@ -425,11 +424,7 @@ static void initialize_tun(void) #include <arpa/inet.h> #include <errno.h> #include <fcntl.h> -#include <linux/if.h> -#include <linux/if_ether.h> -#include <linux/if_tun.h> -#include <linux/ip.h> -#include <linux/tcp.h> +#include <net/if.h> #include <net/if_arp.h> #include <stdarg.h> #include <stdbool.h> @@ -437,6 +432,11 @@ static void initialize_tun(void) #include <sys/stat.h> #include <sys/uio.h> +#include <linux/if_ether.h> +#include <linux/if_tun.h> +#include <linux/ip.h> +#include <linux/tcp.h> + // Addresses are chosen to be in the same subnet as tun addresses. #define DEV_IPV4 "172.20.20.%d" #define DEV_IPV6 "fe80::%02hx" @@ -1208,12 +1208,13 @@ static long syz_kvm_setup_cpu(long a0, long a1, long a2, long a3, long a4, long #if SYZ_EXECUTOR || SYZ_RESET_NET_NAMESPACE #include <errno.h> -#include <linux/if.h> -#include <linux/net.h> +#include <net/if.h> #include <netinet/in.h> #include <string.h> #include <sys/socket.h> +#include <linux/net.h> + // checkpoint/reset_net_namespace partially resets net namespace to initial state // after each test. Currently it resets only ipv4 netfilter state. // Ideally, we just create a new net namespace for each test, |
