aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-07-06 12:15:15 -0400
committerDavid S. Miller <davem@davemloft.net>2016-07-06 12:15:15 -0400
commitae3e4562e2ce0149a4424c994a282955700711e7 (patch)
treeaf7f75611e30d8502c2f3eee9f1f9e1aaa9f6534 /include
parent73e20b761acf8678de2d55d92b90a623b8558a77 (diff)
parentc6ac37d8d8843fb1fdc34e4a2a41a4f027ab670c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for net-next, they are: 1) Don't use userspace datatypes in bridge netfilter code, from Tobin Harding. 2) Iterate only once over the expectation table when removing the helper module, instead of once per-netns, from Florian Westphal. 3) Extra sanitization in xt_hook_ops_alloc() to return error in case we ever pass zero hooks, xt_hook_ops_alloc(): 4) Handle NFPROTO_INET from the logging core infrastructure, from Liping Zhang. 5) Autoload loggers when TRACE target is used from rules, this doesn't change the behaviour in case the user already selected nfnetlink_log as preferred way to print tracing logs, also from Liping Zhang. 6) Conntrack slabs with SLAB_HWCACHE_ALIGN to allow rearranging fields by cache lines, increases the size of entries in 11% per entry. From Florian Westphal. 7) Skip zone comparison if CONFIG_NF_CONNTRACK_ZONES=n, from Florian. 8) Remove useless defensive check in nf_logger_find_get() from Shivani Bhardwaj. 9) Remove zone extension as place it in the conntrack object, this is always include in the hashing and we expect more intensive use of zones since containers are in place. Also from Florian Westphal. 10) Owner match now works from any namespace, from Eric Bierdeman. 11) Make sure we only reply with TCP reset to TCP traffic from nf_reject_ipv4, patch from Liping Zhang. 12) Introduce --nflog-size to indicate amount of network packet bytes that are copied to userspace via log message, from Vishwanath Pai. This obsoletes --nflog-range that has never worked, it was designed to achieve this but it has never worked. 13) Introduce generic macros for nf_tables object generation masks. 14) Use generation mask in table, chain and set objects in nf_tables. This allows fixes interferences with ongoing preparation phase of the commit protocol and object listings going on at the same time. This update is introduced in three patches, one per object. 15) Check if the object is active in the next generation for element deactivation in the rbtree implementation, given that deactivation happens from the commit phase path we have to observe the future status of the object. 16) Support for deletion of just added elements in the hash set type. 17) Allow to resize hashtable from /proc entry, not only from the obscure /sys entry that maps to the module parameter, from Florian Westphal. 18) Get rid of NFT_BASECHAIN_DISABLED, this code is not exercised anymore since we tear down the ruleset whenever the netdevice goes away. 19) Support for matching inverted set lookups, from Arturo Borrero. 20) Simplify the iptables_mangle_hook() by removing a superfluous extra branch. 21) Introduce ether_addr_equal_masked() and use it from the netfilter codebase, from Joe Perches. 22) Remove references to "Use netfilter MARK value as routing key" from the Netfilter Kconfig description given that this toggle doesn't exists already for 10 years, from Moritz Sichert. 23) Introduce generic NF_INVF() and use it from the xtables codebase, from Joe Perches. 24) Setting logger to NONE via /proc was not working unless explicit nul-termination was included in the string. This fixes seems to leave the former behaviour there, so we don't break backward. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/etherdevice.h23
-rw-r--r--include/linux/netfilter/x_tables.h4
-rw-r--r--include/linux/netfilter_bridge/ebtables.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h4
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h4
-rw-r--r--include/net/netfilter/nf_conntrack_zones.h45
-rw-r--r--include/net/netfilter/nf_log.h7
-rw-r--r--include/net/netfilter/nf_tables.h43
-rw-r--r--include/uapi/linux/netfilter/nf_tables.h6
-rw-r--r--include/uapi/linux/netfilter/xt_NFLOG.h6
10 files changed, 108 insertions, 36 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 37ff4a6faa9a..6fec9e81bd70 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -374,6 +374,29 @@ static inline bool ether_addr_equal_unaligned(const u8 *addr1, const u8 *addr2)
374} 374}
375 375
376/** 376/**
377 * ether_addr_equal_masked - Compare two Ethernet addresses with a mask
378 * @addr1: Pointer to a six-byte array containing the 1st Ethernet address
379 * @addr2: Pointer to a six-byte array containing the 2nd Ethernet address
380 * @mask: Pointer to a six-byte array containing the Ethernet address bitmask
381 *
382 * Compare two Ethernet addresses with a mask, returns true if for every bit
383 * set in the bitmask the equivalent bits in the ethernet addresses are equal.
384 * Using a mask with all bits set is a slower ether_addr_equal.
385 */
386static inline bool ether_addr_equal_masked(const u8 *addr1, const u8 *addr2,
387 const u8 *mask)
388{
389 int i;
390
391 for (i = 0; i < ETH_ALEN; i++) {
392 if ((addr1[i] ^ addr2[i]) & mask[i])
393 return false;
394 }
395
396 return true;
397}
398
399/**
377 * is_etherdev_addr - Tell if given Ethernet address belongs to the device. 400 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
378 * @dev: Pointer to a device structure 401 * @dev: Pointer to a device structure
379 * @addr: Pointer to a six-byte array containing the Ethernet address 402 * @addr: Pointer to a six-byte array containing the Ethernet address
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index dc4f58a3cdcc..e94e81ab2b58 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -6,6 +6,10 @@
6#include <linux/static_key.h> 6#include <linux/static_key.h>
7#include <uapi/linux/netfilter/x_tables.h> 7#include <uapi/linux/netfilter/x_tables.h>
8 8
9/* Test a struct->invflags and a boolean for inequality */
10#define NF_INVF(ptr, flag, boolean) \
11 ((boolean) ^ !!((ptr)->invflags & (flag)))
12
9/** 13/**
10 * struct xt_action_param - parameters for matches/targets 14 * struct xt_action_param - parameters for matches/targets
11 * 15 *
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index 2ea517c7c6b9..984b2112c77b 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -115,8 +115,6 @@ extern unsigned int ebt_do_table(struct sk_buff *skb,
115 const struct nf_hook_state *state, 115 const struct nf_hook_state *state,
116 struct ebt_table *table); 116 struct ebt_table *table);
117 117
118/* Used in the kernel match() functions */
119#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg))
120/* True if the hook mask denotes that the rule is in a base chain, 118/* True if the hook mask denotes that the rule is in a base chain,
121 * used in the check() functions */ 119 * used in the check() functions */
122#define BASE_CHAIN (par->hook_mask & (1 << NF_BR_NUMHOOKS)) 120#define BASE_CHAIN (par->hook_mask & (1 << NF_BR_NUMHOOKS))
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index dd78bea227c8..5d3397f34583 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -85,6 +85,9 @@ struct nf_conn {
85 spinlock_t lock; 85 spinlock_t lock;
86 u16 cpu; 86 u16 cpu;
87 87
88#ifdef CONFIG_NF_CONNTRACK_ZONES
89 struct nf_conntrack_zone zone;
90#endif
88 /* XXX should I move this to the tail ? - Y.K */ 91 /* XXX should I move this to the tail ? - Y.K */
89 /* These are my tuples; original and reply */ 92 /* These are my tuples; original and reply */
90 struct nf_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; 93 struct nf_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
@@ -287,6 +290,7 @@ static inline bool nf_is_loopback_packet(const struct sk_buff *skb)
287struct kernel_param; 290struct kernel_param;
288 291
289int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); 292int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
293int nf_conntrack_hash_resize(unsigned int hashsize);
290extern unsigned int nf_conntrack_htable_size; 294extern unsigned int nf_conntrack_htable_size;
291extern unsigned int nf_conntrack_max; 295extern unsigned int nf_conntrack_max;
292 296
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 55d15049ab2f..b925395fa5ed 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -15,9 +15,6 @@ enum nf_ct_ext_id {
15#ifdef CONFIG_NF_CONNTRACK_EVENTS 15#ifdef CONFIG_NF_CONNTRACK_EVENTS
16 NF_CT_EXT_ECACHE, 16 NF_CT_EXT_ECACHE,
17#endif 17#endif
18#ifdef CONFIG_NF_CONNTRACK_ZONES
19 NF_CT_EXT_ZONE,
20#endif
21#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP 18#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
22 NF_CT_EXT_TSTAMP, 19 NF_CT_EXT_TSTAMP,
23#endif 20#endif
@@ -38,7 +35,6 @@ enum nf_ct_ext_id {
38#define NF_CT_EXT_SEQADJ_TYPE struct nf_conn_seqadj 35#define NF_CT_EXT_SEQADJ_TYPE struct nf_conn_seqadj
39#define NF_CT_EXT_ACCT_TYPE struct nf_conn_acct 36#define NF_CT_EXT_ACCT_TYPE struct nf_conn_acct
40#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache 37#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache
41#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone
42#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp 38#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp
43#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout 39#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout
44#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels 40#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels
diff --git a/include/net/netfilter/nf_conntrack_zones.h b/include/net/netfilter/nf_conntrack_zones.h
index 4e32512cef32..64a718b60839 100644
--- a/include/net/netfilter/nf_conntrack_zones.h
+++ b/include/net/netfilter/nf_conntrack_zones.h
@@ -9,12 +9,11 @@
9static inline const struct nf_conntrack_zone * 9static inline const struct nf_conntrack_zone *
10nf_ct_zone(const struct nf_conn *ct) 10nf_ct_zone(const struct nf_conn *ct)
11{ 11{
12 const struct nf_conntrack_zone *nf_ct_zone = NULL;
13
14#ifdef CONFIG_NF_CONNTRACK_ZONES 12#ifdef CONFIG_NF_CONNTRACK_ZONES
15 nf_ct_zone = nf_ct_ext_find(ct, NF_CT_EXT_ZONE); 13 return &ct->zone;
14#else
15 return &nf_ct_zone_dflt;
16#endif 16#endif
17 return nf_ct_zone ? nf_ct_zone : &nf_ct_zone_dflt;
18} 17}
19 18
20static inline const struct nf_conntrack_zone * 19static inline const struct nf_conntrack_zone *
@@ -31,32 +30,22 @@ static inline const struct nf_conntrack_zone *
31nf_ct_zone_tmpl(const struct nf_conn *tmpl, const struct sk_buff *skb, 30nf_ct_zone_tmpl(const struct nf_conn *tmpl, const struct sk_buff *skb,
32 struct nf_conntrack_zone *tmp) 31 struct nf_conntrack_zone *tmp)
33{ 32{
34 const struct nf_conntrack_zone *zone; 33#ifdef CONFIG_NF_CONNTRACK_ZONES
35
36 if (!tmpl) 34 if (!tmpl)
37 return &nf_ct_zone_dflt; 35 return &nf_ct_zone_dflt;
38 36
39 zone = nf_ct_zone(tmpl); 37 if (tmpl->zone.flags & NF_CT_FLAG_MARK)
40 if (zone->flags & NF_CT_FLAG_MARK) 38 return nf_ct_zone_init(tmp, skb->mark, tmpl->zone.dir, 0);
41 zone = nf_ct_zone_init(tmp, skb->mark, zone->dir, 0); 39#endif
42 40 return nf_ct_zone(tmpl);
43 return zone;
44} 41}
45 42
46static inline int nf_ct_zone_add(struct nf_conn *ct, gfp_t flags, 43static inline void nf_ct_zone_add(struct nf_conn *ct,
47 const struct nf_conntrack_zone *info) 44 const struct nf_conntrack_zone *zone)
48{ 45{
49#ifdef CONFIG_NF_CONNTRACK_ZONES 46#ifdef CONFIG_NF_CONNTRACK_ZONES
50 struct nf_conntrack_zone *nf_ct_zone; 47 ct->zone = *zone;
51
52 nf_ct_zone = nf_ct_ext_add(ct, NF_CT_EXT_ZONE, flags);
53 if (!nf_ct_zone)
54 return -ENOMEM;
55
56 nf_ct_zone_init(nf_ct_zone, info->id, info->dir,
57 info->flags);
58#endif 48#endif
59 return 0;
60} 49}
61 50
62static inline bool nf_ct_zone_matches_dir(const struct nf_conntrack_zone *zone, 51static inline bool nf_ct_zone_matches_dir(const struct nf_conntrack_zone *zone,
@@ -68,22 +57,34 @@ static inline bool nf_ct_zone_matches_dir(const struct nf_conntrack_zone *zone,
68static inline u16 nf_ct_zone_id(const struct nf_conntrack_zone *zone, 57static inline u16 nf_ct_zone_id(const struct nf_conntrack_zone *zone,
69 enum ip_conntrack_dir dir) 58 enum ip_conntrack_dir dir)
70{ 59{
60#ifdef CONFIG_NF_CONNTRACK_ZONES
71 return nf_ct_zone_matches_dir(zone, dir) ? 61 return nf_ct_zone_matches_dir(zone, dir) ?
72 zone->id : NF_CT_DEFAULT_ZONE_ID; 62 zone->id : NF_CT_DEFAULT_ZONE_ID;
63#else
64 return NF_CT_DEFAULT_ZONE_ID;
65#endif
73} 66}
74 67
75static inline bool nf_ct_zone_equal(const struct nf_conn *a, 68static inline bool nf_ct_zone_equal(const struct nf_conn *a,
76 const struct nf_conntrack_zone *b, 69 const struct nf_conntrack_zone *b,
77 enum ip_conntrack_dir dir) 70 enum ip_conntrack_dir dir)
78{ 71{
72#ifdef CONFIG_NF_CONNTRACK_ZONES
79 return nf_ct_zone_id(nf_ct_zone(a), dir) == 73 return nf_ct_zone_id(nf_ct_zone(a), dir) ==
80 nf_ct_zone_id(b, dir); 74 nf_ct_zone_id(b, dir);
75#else
76 return true;
77#endif
81} 78}
82 79
83static inline bool nf_ct_zone_equal_any(const struct nf_conn *a, 80static inline bool nf_ct_zone_equal_any(const struct nf_conn *a,
84 const struct nf_conntrack_zone *b) 81 const struct nf_conntrack_zone *b)
85{ 82{
83#ifdef CONFIG_NF_CONNTRACK_ZONES
86 return nf_ct_zone(a)->id == b->id; 84 return nf_ct_zone(a)->id == b->id;
85#else
86 return true;
87#endif
87} 88}
88#endif /* IS_ENABLED(CONFIG_NF_CONNTRACK) */ 89#endif /* IS_ENABLED(CONFIG_NF_CONNTRACK) */
89#endif /* _NF_CONNTRACK_ZONES_H */ 90#endif /* _NF_CONNTRACK_ZONES_H */
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h
index 57639fca223a..83d855ba6af1 100644
--- a/include/net/netfilter/nf_log.h
+++ b/include/net/netfilter/nf_log.h
@@ -12,6 +12,9 @@
12#define NF_LOG_UID 0x08 /* Log UID owning local socket */ 12#define NF_LOG_UID 0x08 /* Log UID owning local socket */
13#define NF_LOG_MASK 0x0f 13#define NF_LOG_MASK 0x0f
14 14
15/* This flag indicates that copy_len field in nf_loginfo is set */
16#define NF_LOG_F_COPY_LEN 0x1
17
15enum nf_log_type { 18enum nf_log_type {
16 NF_LOG_TYPE_LOG = 0, 19 NF_LOG_TYPE_LOG = 0,
17 NF_LOG_TYPE_ULOG, 20 NF_LOG_TYPE_ULOG,
@@ -22,9 +25,13 @@ struct nf_loginfo {
22 u_int8_t type; 25 u_int8_t type;
23 union { 26 union {
24 struct { 27 struct {
28 /* copy_len will be used iff you set
29 * NF_LOG_F_COPY_LEN in flags
30 */
25 u_int32_t copy_len; 31 u_int32_t copy_len;
26 u_int16_t group; 32 u_int16_t group;
27 u_int16_t qthreshold; 33 u_int16_t qthreshold;
34 u_int16_t flags;
28 } ulog; 35 } ulog;
29 struct { 36 struct {
30 u_int8_t level; 37 u_int8_t level;
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index f7c291ff4074..30c1d9489ae2 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -297,6 +297,7 @@ void nft_unregister_set(struct nft_set_ops *ops);
297 * @ops: set ops 297 * @ops: set ops
298 * @pnet: network namespace 298 * @pnet: network namespace
299 * @flags: set flags 299 * @flags: set flags
300 * @genmask: generation mask
300 * @klen: key length 301 * @klen: key length
301 * @dlen: data length 302 * @dlen: data length
302 * @data: private set data 303 * @data: private set data
@@ -318,7 +319,8 @@ struct nft_set {
318 /* runtime data below here */ 319 /* runtime data below here */
319 const struct nft_set_ops *ops ____cacheline_aligned; 320 const struct nft_set_ops *ops ____cacheline_aligned;
320 possible_net_t pnet; 321 possible_net_t pnet;
321 u16 flags; 322 u16 flags:14,
323 genmask:2;
322 u8 klen; 324 u8 klen;
323 u8 dlen; 325 u8 dlen;
324 unsigned char data[] 326 unsigned char data[]
@@ -336,9 +338,9 @@ static inline struct nft_set *nft_set_container_of(const void *priv)
336} 338}
337 339
338struct nft_set *nf_tables_set_lookup(const struct nft_table *table, 340struct nft_set *nf_tables_set_lookup(const struct nft_table *table,
339 const struct nlattr *nla); 341 const struct nlattr *nla, u8 genmask);
340struct nft_set *nf_tables_set_lookup_byid(const struct net *net, 342struct nft_set *nf_tables_set_lookup_byid(const struct net *net,
341 const struct nlattr *nla); 343 const struct nlattr *nla, u8 genmask);
342 344
343static inline unsigned long nft_set_gc_interval(const struct nft_set *set) 345static inline unsigned long nft_set_gc_interval(const struct nft_set *set)
344{ 346{
@@ -733,7 +735,6 @@ static inline struct nft_userdata *nft_userdata(const struct nft_rule *rule)
733 735
734enum nft_chain_flags { 736enum nft_chain_flags {
735 NFT_BASE_CHAIN = 0x1, 737 NFT_BASE_CHAIN = 0x1,
736 NFT_CHAIN_INACTIVE = 0x2,
737}; 738};
738 739
739/** 740/**
@@ -755,7 +756,8 @@ struct nft_chain {
755 u64 handle; 756 u64 handle;
756 u32 use; 757 u32 use;
757 u16 level; 758 u16 level;
758 u8 flags; 759 u8 flags:6,
760 genmask:2;
759 char name[NFT_CHAIN_MAXNAMELEN]; 761 char name[NFT_CHAIN_MAXNAMELEN];
760}; 762};
761 763
@@ -797,7 +799,6 @@ struct nft_stats {
797}; 799};
798 800
799#define NFT_HOOK_OPS_MAX 2 801#define NFT_HOOK_OPS_MAX 2
800#define NFT_BASECHAIN_DISABLED (1 << 0)
801 802
802/** 803/**
803 * struct nft_base_chain - nf_tables base chain 804 * struct nft_base_chain - nf_tables base chain
@@ -839,6 +840,7 @@ unsigned int nft_do_chain(struct nft_pktinfo *pkt, void *priv);
839 * @hgenerator: handle generator state 840 * @hgenerator: handle generator state
840 * @use: number of chain references to this table 841 * @use: number of chain references to this table
841 * @flags: table flag (see enum nft_table_flags) 842 * @flags: table flag (see enum nft_table_flags)
843 * @genmask: generation mask
842 * @name: name of the table 844 * @name: name of the table
843 */ 845 */
844struct nft_table { 846struct nft_table {
@@ -847,7 +849,8 @@ struct nft_table {
847 struct list_head sets; 849 struct list_head sets;
848 u64 hgenerator; 850 u64 hgenerator;
849 u32 use; 851 u32 use;
850 u16 flags; 852 u16 flags:14,
853 genmask:2;
851 char name[NFT_TABLE_MAXNAMELEN]; 854 char name[NFT_TABLE_MAXNAMELEN];
852}; 855};
853 856
@@ -971,6 +974,32 @@ static inline u8 nft_genmask_cur(const struct net *net)
971#define NFT_GENMASK_ANY ((1 << 0) | (1 << 1)) 974#define NFT_GENMASK_ANY ((1 << 0) | (1 << 1))
972 975
973/* 976/*
977 * Generic transaction helpers
978 */
979
980/* Check if this object is currently active. */
981#define nft_is_active(__net, __obj) \
982 (((__obj)->genmask & nft_genmask_cur(__net)) == 0)
983
984/* Check if this object is active in the next generation. */
985#define nft_is_active_next(__net, __obj) \
986 (((__obj)->genmask & nft_genmask_next(__net)) == 0)
987
988/* This object becomes active in the next generation. */
989#define nft_activate_next(__net, __obj) \
990 (__obj)->genmask = nft_genmask_cur(__net)
991
992/* This object becomes inactive in the next generation. */
993#define nft_deactivate_next(__net, __obj) \
994 (__obj)->genmask = nft_genmask_next(__net)
995
996/* After committing the ruleset, clear the stale generation bit. */
997#define nft_clear(__net, __obj) \
998 (__obj)->genmask &= ~nft_genmask_next(__net)
999#define nft_active_genmask(__obj, __genmask) \
1000 !((__obj)->genmask & __genmask)
1001
1002/*
974 * Set element transaction helpers 1003 * Set element transaction helpers
975 */ 1004 */
976 1005
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index 6a4dbe04f09e..01751faccaf8 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -546,6 +546,10 @@ enum nft_cmp_attributes {
546}; 546};
547#define NFTA_CMP_MAX (__NFTA_CMP_MAX - 1) 547#define NFTA_CMP_MAX (__NFTA_CMP_MAX - 1)
548 548
549enum nft_lookup_flags {
550 NFT_LOOKUP_F_INV = (1 << 0),
551};
552
549/** 553/**
550 * enum nft_lookup_attributes - nf_tables set lookup expression netlink attributes 554 * enum nft_lookup_attributes - nf_tables set lookup expression netlink attributes
551 * 555 *
@@ -553,6 +557,7 @@ enum nft_cmp_attributes {
553 * @NFTA_LOOKUP_SREG: source register of the data to look for (NLA_U32: nft_registers) 557 * @NFTA_LOOKUP_SREG: source register of the data to look for (NLA_U32: nft_registers)
554 * @NFTA_LOOKUP_DREG: destination register (NLA_U32: nft_registers) 558 * @NFTA_LOOKUP_DREG: destination register (NLA_U32: nft_registers)
555 * @NFTA_LOOKUP_SET_ID: uniquely identifies a set in a transaction (NLA_U32) 559 * @NFTA_LOOKUP_SET_ID: uniquely identifies a set in a transaction (NLA_U32)
560 * @NFTA_LOOKUP_FLAGS: flags (NLA_U32: enum nft_lookup_flags)
556 */ 561 */
557enum nft_lookup_attributes { 562enum nft_lookup_attributes {
558 NFTA_LOOKUP_UNSPEC, 563 NFTA_LOOKUP_UNSPEC,
@@ -560,6 +565,7 @@ enum nft_lookup_attributes {
560 NFTA_LOOKUP_SREG, 565 NFTA_LOOKUP_SREG,
561 NFTA_LOOKUP_DREG, 566 NFTA_LOOKUP_DREG,
562 NFTA_LOOKUP_SET_ID, 567 NFTA_LOOKUP_SET_ID,
568 NFTA_LOOKUP_FLAGS,
563 __NFTA_LOOKUP_MAX 569 __NFTA_LOOKUP_MAX
564}; 570};
565#define NFTA_LOOKUP_MAX (__NFTA_LOOKUP_MAX - 1) 571#define NFTA_LOOKUP_MAX (__NFTA_LOOKUP_MAX - 1)
diff --git a/include/uapi/linux/netfilter/xt_NFLOG.h b/include/uapi/linux/netfilter/xt_NFLOG.h
index 87b58311ce6b..f33070730fc8 100644
--- a/include/uapi/linux/netfilter/xt_NFLOG.h
+++ b/include/uapi/linux/netfilter/xt_NFLOG.h
@@ -6,9 +6,13 @@
6#define XT_NFLOG_DEFAULT_GROUP 0x1 6#define XT_NFLOG_DEFAULT_GROUP 0x1
7#define XT_NFLOG_DEFAULT_THRESHOLD 0 7#define XT_NFLOG_DEFAULT_THRESHOLD 0
8 8
9#define XT_NFLOG_MASK 0x0 9#define XT_NFLOG_MASK 0x1
10
11/* This flag indicates that 'len' field in xt_nflog_info is set*/
12#define XT_NFLOG_F_COPY_LEN 0x1
10 13
11struct xt_nflog_info { 14struct xt_nflog_info {
15 /* 'len' will be used iff you set XT_NFLOG_F_COPY_LEN in flags */
12 __u32 len; 16 __u32 len;
13 __u16 group; 17 __u16 group;
14 __u16 threshold; 18 __u16 threshold;