From 0c2fa87bc67b35886d2ff79d0a430b997e1ffee4 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 27 Sep 2018 15:34:52 +0200 Subject: executor: fix build on newer linux distros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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*’ --- executor/common_linux.h | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'executor') 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 +#include #include #include #include @@ -1234,8 +1235,39 @@ static void reset_arptables() close(fd); } -#include -#include +// 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; -- cgit mrf-deployment