Re: [PATCH] netfilter: resolve compilation error in userspace when using ip_tables.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 22, 2016 at 04:04:30PM +0200, Jan Engelhardt wrote:
> Compilation of iptables plugins which include these two lines
> 
> 	#include <xtables.h>
> 	#include <linux/netfilter_ipv4/ip_tables.h>
> 
> fails since commit 1ffad83dffd675cd742286ae82dca7d746cb0da8, because
> the userspace parts almost everywhere include <net/if.h>, which
> collides with <linux/if.h>.
> 
> Use the __KERNEL__ trick that was last present in
> d16cf20e2f2f13411eece7f7fb72c17d141c4a84^:include/linux/netfilter_ipv4/ip_queue.h
> to resolve this.
> 
> Signed-off-by: Jan Engelhardt <jengelh@xxxxxxx>
> ---
>  include/uapi/linux/netfilter_ipv4/ip_tables.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/netfilter_ipv4/ip_tables.h b/include/uapi/linux/netfilter_ipv4/ip_tables.h
> index d0da53d..784a4b7 100644
> --- a/include/uapi/linux/netfilter_ipv4/ip_tables.h
> +++ b/include/uapi/linux/netfilter_ipv4/ip_tables.h
> @@ -17,7 +17,11 @@
>  
>  #include <linux/types.h>
>  #include <linux/compiler.h>
> -#include <linux/if.h>
> +#ifdef __KERNEL__
> +#	include <linux/if.h>
> +#else
> +#	include <net/if.h>
> +#endif

When I tried to fix uapi header compile problems like this, they got rejected
in review since kernel uapi headers should not include on glibc headers.

I hope http://marc.info/?l=linux-kernel&m=146151279018490
fixes this. If not, then I guess the headers include kernel side headers
before glibc ones and need some #define magic into glibc.

-Mikko
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux