diff options
author | Duncan Roe <duncan_roe@optusnet.com.au> | 2018-05-15 08:26:43 +1000 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-05-15 00:37:04 +0200 |
commit | 66a97018a31eed416c6a25d051ea172e4d65be1b (patch) | |
tree | 6ddc5b0344df0a9b882c0879885ff2554194aa6c /include | |
parent | 9fff3d5f9da00255463d28b38d688c25025b7fb1 (diff) |
ebtables: Fix build errors and warnings
Since commit b1cdae87f25021eb835872d86d6e7206bd421c3f, make fails thusly:
> libebtc.c: In function 'ebt_reinit_extensions':
> libebtc.c:275:11: error: 'union <anonymous>' has no member named 'revision'
> m->m->u.revision = m->revision;
> ^
> libebtc.c: In function 'ebt_check_rule_exists':
> libebtc.c:555:21: error: 'union <anonymous>' has no member named 'revision'
> m_l2->m->u.revision != m->m->u.revision)) {
> ^
> libebtc.c:555:41: error: 'union <anonymous>' has no member named 'revision'
> m_l2->m->u.revision != m->m->u.revision)) {
> ^
> libebtc.c: In function 'ebt_register_match':
> libebtc.c:1215:9: error: 'union <anonymous>' has no member named 'revision'
> m->m->u.revision = m->revision;
> ^
The cause of this failure is that the commit updated include/ebtables.h but
libebtc.c uses include/linux/netfilter_bridge/ebtables.h via
include/ebtables_u.h (gcc -E -C verifies this).
The 2 versions of ebtables.h looked to me to be otherwise close enough, so
amended ebtables_u.h to use the newer one.
Makefile insists on being warning-free, so cleared up warnings. Apart from
unused variables, there was also the issue that the diagnostic macro
ebt_print_error2 *returns* (i.e. makes its caller return) and returns -1. This
is unsuitable for use in functions which do not return a value, so introduced
ebt_print_error3 to do this.
Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/ebtables_u.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/ebtables_u.h b/include/ebtables_u.h index 4824a14..7adc5a2 100644 --- a/include/ebtables_u.h +++ b/include/ebtables_u.h @@ -25,7 +25,7 @@ #define EBTABLES_U_H #include <netinet/in.h> #include <netinet/ether.h> -#include <linux/netfilter_bridge/ebtables.h> +#include <ebtables.h> #include <linux/netfilter/x_tables.h> #ifndef IPPROTO_SCTP @@ -338,6 +338,8 @@ _ch;}) #define ebt_print_error(format,args...) __ebt_print_error(format, ##args); #define ebt_print_error2(format, args...) do {__ebt_print_error(format, ##args); \ return -1;} while (0) +#define ebt_print_error3(format, args...) do {__ebt_print_error(format, ##args); \ + return;} while (0) #define ebt_check_option2(flags,mask) \ ({ebt_check_option(flags,mask); \ if (ebt_errormsg[0] != '\0') \ |