Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: add defines for arp/decnet max hooks

The kernel already has defines for this, but they are in uapi exposed
headers.

Including these from netns.h causes build errors and also adds unneeded
dependencies on heads that we don't need.

So move these defines to netfilter_defs.h and place the uapi ones
in ifndef __KERNEL__ to keep them for userspace.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Florian Westphal and committed by
Pablo Neira Ayuso
e58f33cc b0f38338

+12 -1
+6
include/linux/netfilter_defs.h
··· 7 7 /* Largest hook number + 1, see uapi/linux/netfilter_decnet.h */ 8 8 #define NF_MAX_HOOKS 8 9 9 10 + /* in/out/forward only */ 11 + #define NF_ARP_NUMHOOKS 3 12 + 13 + /* max hook is NF_DN_ROUTE (6), also see uapi/linux/netfilter_decnet.h */ 14 + #define NF_DN_NUMHOOKS 7 15 + 10 16 #endif
+3
include/uapi/linux/netfilter_arp.h
··· 15 15 #define NF_ARP_IN 0 16 16 #define NF_ARP_OUT 1 17 17 #define NF_ARP_FORWARD 2 18 + 19 + #ifndef __KERNEL__ 18 20 #define NF_ARP_NUMHOOKS 3 21 + #endif 19 22 20 23 #endif /* __LINUX_ARP_NETFILTER_H */
+3 -1
include/uapi/linux/netfilter_decnet.h
··· 24 24 #define NFC_DN_IF_IN 0x0004 25 25 /* Output device. */ 26 26 #define NFC_DN_IF_OUT 0x0008 27 + 28 + /* kernel define is in netfilter_defs.h */ 29 + #define NF_DN_NUMHOOKS 7 27 30 #endif /* ! __KERNEL__ */ 28 31 29 32 /* DECnet Hooks */ ··· 44 41 #define NF_DN_HELLO 5 45 42 /* Input Routing Packets */ 46 43 #define NF_DN_ROUTE 6 47 - #define NF_DN_NUMHOOKS 7 48 44 49 45 enum nf_dn_hook_priorities { 50 46 NF_DN_PRI_FIRST = INT_MIN,