uapi: ebtables: don't include linux/if.h
Subsystems (2)
PATCH 1/1 uapi: ebtables: don't include linux/if.h
From: Pablo Neira Ayuso <[email protected]>
linux/if.h creates conflicts in userspace with net/if.h
By using it here we force userspace to use linux/if.h while net/if.h may be needed.
--- include/linux/netfilter_bridge/ebtables.h | 3 ++- include/uapi/linux/netfilter_bridge/ebtables.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-)
include/linux/netfilter_bridge/ebtables.h +2 -1
@@ -12,9 +12,10 @@#ifndef __LINUX_BRIDGE_EFF_H#define __LINUX_BRIDGE_EFF_H +#include <linux/if.h> +#include <linux/if_ether.h> #include <uapi/linux/netfilter_bridge/ebtables.h> -/* return values for match() functions */ #define EBT_MATCH 0#define EBT_NOMATCH 1
include/uapi/linux/netfilter_bridge/ebtables.h +0 -2
@@ -12,9 +12,7 @@#ifndef _UAPI__LINUX_BRIDGE_EFF_H#define _UAPI__LINUX_BRIDGE_EFF_H -#include <linux/if.h> #include <linux/netfilter_bridge.h> -#include <linux/if_ether.h> #define EBT_TABLE_MAXNAMELEN 32#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
Pablo Neira Ayuso
maintainerQuoted 6 lines · Arturo Borrero Gonzalez
From: Pablo Neira Ayuso <[email protected]>
linux/if.hcreates conflicts in userspace withnet/if.hBy using it here we force userspace to use
linux/if.hwhilenet/if.hmay be needed.
I'm going to add here that:
include/linux/netfilter_ipv4/ip_tables.h andinclude/linux/netfilter_ipv6/ip6_tables.h
don't include linux/if.h and they also refer to IFNAMSIZ, so they are expecting userspace to include use net/if.h from the client program.
This has been causing us problems in the xt over nft layer.
If nobody objects, I'll push this to nf-next.
Quoted 38 lines
Signed-off-by Pablo Neira Ayuso <[email protected]>Signed-off-by Arturo Borrero Gonzalez <[email protected]>--- include/linux/netfilter_bridge/ebtables.h | 3 ++- include/uapi/linux/netfilter_bridge/ebtables.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-)include/linux/netfilter_bridge/ebtables.h +2
-1@@ -12,9 +12,10 @@#ifndef __LINUX_BRIDGE_EFF_H#define __LINUX_BRIDGE_EFF_H +#include <linux/if.h> +#include <linux/if_ether.h> #include <uapi/linux/netfilter_bridge/ebtables.h> -/* return values for match() functions */ #define EBT_MATCH 0#define EBT_NOMATCH 1include/uapi/linux/netfilter_bridge/ebtables.h +0
-2@@ -12,9 +12,7 @@#ifndef _UAPI__LINUX_BRIDGE_EFF_H#define _UAPI__LINUX_BRIDGE_EFF_H -#include <linux/if.h> #include <linux/netfilter_bridge.h> -#include <linux/if_ether.h> #define EBT_TABLE_MAXNAMELEN 32#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
Quoted 8 lines · Pablo Neira Ayuso
Quoted 6 lines · Arturo Borrero Gonzalez
From: Pablo Neira Ayuso <[email protected]>
linux/if.hcreates conflicts in userspace withnet/if.hBy using it here we force userspace to use
linux/if.hwhilenet/if.hmay be needed.
Quoted 7 lines
I'm going to add here that:
include/linux/netfilter_ipv4/ip_tables.handinclude/linux/netfilter_ipv6/ip6_tables.hdon't include
linux/if.hand they also refer to IFNAMSIZ, so they are expecting userspace to include usenet/if.hfrom the client program.
Applied, thanks Arturo.