diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-09-27 15:34:52 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-09-27 15:34:52 +0200 |
| commit | 0c2fa87bc67b35886d2ff79d0a430b997e1ffee4 (patch) | |
| tree | 1e3c110e2b06bd3c58662b347afcf2c50eab5ed8 /executor | |
| parent | 98b28ead6ceaf22064b9715cc1950848d2bdef0b (diff) | |
executor: fix build on newer linux distros
This sucks a lot, but ebtables.h is now broken too on Debian 4.17:
ebtables.h: In function ‘ebt_entry_target* ebt_get_target(ebt_entry*)’:
ebtables.h:197:19: error: invalid conversion from ‘void*’ to ‘ebt_entry_target*’
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common_linux.h | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index 6980d8ca6..e0dcd9caf 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -915,6 +915,7 @@ static bool write_file(const char* file, const char* what, ...) #if SYZ_EXECUTOR || SYZ_RESET_NET_NAMESPACE #include <errno.h> +#include <linux/if.h> #include <linux/net.h> #include <netinet/in.h> #include <string.h> @@ -1234,8 +1235,39 @@ static void reset_arptables() close(fd); } -#include <linux/if.h> -#include <linux/netfilter_bridge/ebtables.h> +// ebtables.h is broken too: +// ebtables.h: In function ‘ebt_entry_target* ebt_get_target(ebt_entry*)’: +// ebtables.h:197:19: error: invalid conversion from ‘void*’ to ‘ebt_entry_target*’ + +#define NF_BR_NUMHOOKS 6 +#define EBT_TABLE_MAXNAMELEN 32 +#define EBT_CHAIN_MAXNAMELEN 32 +#define EBT_BASE_CTL 128 +#define EBT_SO_SET_ENTRIES (EBT_BASE_CTL) +#define EBT_SO_GET_INFO (EBT_BASE_CTL) +#define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO + 1) +#define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES + 1) +#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO + 1) + +struct ebt_replace { + char name[EBT_TABLE_MAXNAMELEN]; + unsigned int valid_hooks; + unsigned int nentries; + unsigned int entries_size; + struct ebt_entries* hook_entry[NF_BR_NUMHOOKS]; + unsigned int num_counters; + struct ebt_counter* counters; + char* entries; +}; + +struct ebt_entries { + unsigned int distinguisher; + char name[EBT_CHAIN_MAXNAMELEN]; + unsigned int counter_offset; + int policy; + unsigned int nentries; + char data[0] __attribute__((aligned(__alignof__(struct ebt_replace)))); +}; struct ebt_table_desc { const char* name; |
