diff options
| author | David S. Miller <davem@davemloft.net> | 2014-03-17 15:06:24 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-03-17 15:06:24 -0400 |
| commit | e86e180b824e00733bd0e499d412a595078f9b51 (patch) | |
| tree | ebda350b99785b4d0dd0188dd28fa17ec8135474 /include | |
| parent | e7ef085d0a9dc1cc72e7d8108ed3b4e1a5e8d938 (diff) | |
| parent | 7d08487777c8b30dea34790734d708470faaf1e5 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
Pablo Neira Ayuso says:
====================
Netfilter/IPVS updates for net-next
The following patchset contains Netfilter/IPVS updates for net-next,
most relevantly they are:
* cleanup to remove double semicolon from stephen hemminger.
* calm down sparse warning in xt_ipcomp, from Fan Du.
* nf_ct_labels support for nf_tables, from Florian Westphal.
* new macros to simplify rcu dereferences in the scope of nfnetlink
and nf_tables, from Patrick McHardy.
* Accept queue and drop (including reason for drop) to verdict
parsing in nf_tables, also from Patrick.
* Remove unused random seed initialization in nfnetlink_log, from
Florian Westphal.
* Allow to attach user-specific information to nf_tables rules, useful
to attach user comments to rule, from me.
* Return errors in ipset according to the manpage documentation, from
Jozsef Kadlecsik.
* Fix coccinelle warnings related to incorrect bool type usage for ipset,
from Fengguang Wu.
* Add hash:ip,mark set type to ipset, from Vytas Dauksa.
* Fix message for each spotted by ipset for each netns that is created,
from Ilia Mirkin.
* Add forceadd option to ipset, which evicts a random entry from the set
if it becomes full, from Josh Hunt.
* Minor IPVS cleanups and fixes from Andi Kleen and Tingwei Liu.
* Improve conntrack scalability by removing a central spinlock, original
work from Eric Dumazet. Jesper Dangaard Brouer took them over to address
remaining issues. Several patches to prepare this change come in first
place.
* Rework nft_hash to resolve bugs (leaking chain, missing rcu synchronization
on element removal, etc. from Patrick McHardy.
* Restore context in the rule deletion path, as we now release rule objects
synchronously, from Patrick McHardy. This gets back event notification for
anonymous sets.
* Fix NAT family validation in nft_nat, also from Patrick.
* Improve scalability of xt_connlimit by using an array of spinlocks and
by introducing a rb-tree of hashtables for faster lookup of accounted
objects per network. This patch was preceded by several patches and
refactorizations to accomodate this change including the use of kmem_cache,
from Florian Westphal.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netfilter/ipset/ip_set.h | 15 | ||||
| -rw-r--r-- | include/linux/netfilter/nfnetlink.h | 21 | ||||
| -rw-r--r-- | include/net/netfilter/nf_conntrack.h | 11 | ||||
| -rw-r--r-- | include/net/netfilter/nf_conntrack_core.h | 9 | ||||
| -rw-r--r-- | include/net/netfilter/nf_conntrack_labels.h | 4 | ||||
| -rw-r--r-- | include/net/netfilter/nf_tables.h | 28 | ||||
| -rw-r--r-- | include/net/netns/conntrack.h | 13 | ||||
| -rw-r--r-- | include/uapi/linux/netfilter/ipset/ip_set.h | 12 | ||||
| -rw-r--r-- | include/uapi/linux/netfilter/nf_tables.h | 6 |
9 files changed, 96 insertions, 23 deletions
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h index 0c7d01eae56c..96afc29184be 100644 --- a/include/linux/netfilter/ipset/ip_set.h +++ b/include/linux/netfilter/ipset/ip_set.h | |||
| @@ -39,11 +39,13 @@ enum ip_set_feature { | |||
| 39 | IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), | 39 | IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), |
| 40 | IPSET_TYPE_IFACE_FLAG = 5, | 40 | IPSET_TYPE_IFACE_FLAG = 5, |
| 41 | IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG), | 41 | IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG), |
| 42 | IPSET_TYPE_NOMATCH_FLAG = 6, | 42 | IPSET_TYPE_MARK_FLAG = 6, |
| 43 | IPSET_TYPE_MARK = (1 << IPSET_TYPE_MARK_FLAG), | ||
| 44 | IPSET_TYPE_NOMATCH_FLAG = 7, | ||
| 43 | IPSET_TYPE_NOMATCH = (1 << IPSET_TYPE_NOMATCH_FLAG), | 45 | IPSET_TYPE_NOMATCH = (1 << IPSET_TYPE_NOMATCH_FLAG), |
| 44 | /* Strictly speaking not a feature, but a flag for dumping: | 46 | /* Strictly speaking not a feature, but a flag for dumping: |
| 45 | * this settype must be dumped last */ | 47 | * this settype must be dumped last */ |
| 46 | IPSET_DUMP_LAST_FLAG = 7, | 48 | IPSET_DUMP_LAST_FLAG = 8, |
| 47 | IPSET_DUMP_LAST = (1 << IPSET_DUMP_LAST_FLAG), | 49 | IPSET_DUMP_LAST = (1 << IPSET_DUMP_LAST_FLAG), |
| 48 | }; | 50 | }; |
| 49 | 51 | ||
| @@ -63,6 +65,7 @@ enum ip_set_extension { | |||
| 63 | #define SET_WITH_TIMEOUT(s) ((s)->extensions & IPSET_EXT_TIMEOUT) | 65 | #define SET_WITH_TIMEOUT(s) ((s)->extensions & IPSET_EXT_TIMEOUT) |
| 64 | #define SET_WITH_COUNTER(s) ((s)->extensions & IPSET_EXT_COUNTER) | 66 | #define SET_WITH_COUNTER(s) ((s)->extensions & IPSET_EXT_COUNTER) |
| 65 | #define SET_WITH_COMMENT(s) ((s)->extensions & IPSET_EXT_COMMENT) | 67 | #define SET_WITH_COMMENT(s) ((s)->extensions & IPSET_EXT_COMMENT) |
| 68 | #define SET_WITH_FORCEADD(s) ((s)->flags & IPSET_CREATE_FLAG_FORCEADD) | ||
| 66 | 69 | ||
| 67 | /* Extension id, in size order */ | 70 | /* Extension id, in size order */ |
| 68 | enum ip_set_ext_id { | 71 | enum ip_set_ext_id { |
| @@ -171,8 +174,6 @@ struct ip_set_type { | |||
| 171 | char name[IPSET_MAXNAMELEN]; | 174 | char name[IPSET_MAXNAMELEN]; |
| 172 | /* Protocol version */ | 175 | /* Protocol version */ |
| 173 | u8 protocol; | 176 | u8 protocol; |
| 174 | /* Set features to control swapping */ | ||
| 175 | u8 features; | ||
| 176 | /* Set type dimension */ | 177 | /* Set type dimension */ |
| 177 | u8 dimension; | 178 | u8 dimension; |
| 178 | /* | 179 | /* |
| @@ -182,6 +183,8 @@ struct ip_set_type { | |||
| 182 | u8 family; | 183 | u8 family; |
| 183 | /* Type revisions */ | 184 | /* Type revisions */ |
| 184 | u8 revision_min, revision_max; | 185 | u8 revision_min, revision_max; |
| 186 | /* Set features to control swapping */ | ||
| 187 | u16 features; | ||
| 185 | 188 | ||
| 186 | /* Create set */ | 189 | /* Create set */ |
| 187 | int (*create)(struct net *net, struct ip_set *set, | 190 | int (*create)(struct net *net, struct ip_set *set, |
| @@ -217,6 +220,8 @@ struct ip_set { | |||
| 217 | u8 revision; | 220 | u8 revision; |
| 218 | /* Extensions */ | 221 | /* Extensions */ |
| 219 | u8 extensions; | 222 | u8 extensions; |
| 223 | /* Create flags */ | ||
| 224 | u8 flags; | ||
| 220 | /* Default timeout value, if enabled */ | 225 | /* Default timeout value, if enabled */ |
| 221 | u32 timeout; | 226 | u32 timeout; |
| 222 | /* Element data size */ | 227 | /* Element data size */ |
| @@ -251,6 +256,8 @@ ip_set_put_flags(struct sk_buff *skb, struct ip_set *set) | |||
| 251 | cadt_flags |= IPSET_FLAG_WITH_COUNTERS; | 256 | cadt_flags |= IPSET_FLAG_WITH_COUNTERS; |
| 252 | if (SET_WITH_COMMENT(set)) | 257 | if (SET_WITH_COMMENT(set)) |
| 253 | cadt_flags |= IPSET_FLAG_WITH_COMMENT; | 258 | cadt_flags |= IPSET_FLAG_WITH_COMMENT; |
| 259 | if (SET_WITH_FORCEADD(set)) | ||
| 260 | cadt_flags |= IPSET_FLAG_WITH_FORCEADD; | ||
| 254 | 261 | ||
| 255 | if (!cadt_flags) | 262 | if (!cadt_flags) |
| 256 | return 0; | 263 | return 0; |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 28c74367e900..e955d4730625 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -44,6 +44,27 @@ int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid, | |||
| 44 | 44 | ||
| 45 | void nfnl_lock(__u8 subsys_id); | 45 | void nfnl_lock(__u8 subsys_id); |
| 46 | void nfnl_unlock(__u8 subsys_id); | 46 | void nfnl_unlock(__u8 subsys_id); |
| 47 | #ifdef CONFIG_PROVE_LOCKING | ||
| 48 | int lockdep_nfnl_is_held(__u8 subsys_id); | ||
| 49 | #else | ||
| 50 | static inline int lockdep_nfnl_is_held(__u8 subsys_id) | ||
| 51 | { | ||
| 52 | return 1; | ||
| 53 | } | ||
| 54 | #endif /* CONFIG_PROVE_LOCKING */ | ||
| 55 | |||
| 56 | /* | ||
| 57 | * nfnl_dereference - fetch RCU pointer when updates are prevented by subsys mutex | ||
| 58 | * | ||
| 59 | * @p: The pointer to read, prior to dereferencing | ||
| 60 | * @ss: The nfnetlink subsystem ID | ||
| 61 | * | ||
| 62 | * Return the value of the specified RCU-protected pointer, but omit | ||
| 63 | * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because | ||
| 64 | * caller holds the NFNL subsystem mutex. | ||
| 65 | */ | ||
| 66 | #define nfnl_dereference(p, ss) \ | ||
| 67 | rcu_dereference_protected(p, lockdep_nfnl_is_held(ss)) | ||
| 47 | 68 | ||
| 48 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ | 69 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ |
| 49 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) | 70 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index b2ac6246b7e0..37252f71a380 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
| @@ -73,10 +73,17 @@ struct nf_conn_help { | |||
| 73 | 73 | ||
| 74 | struct nf_conn { | 74 | struct nf_conn { |
| 75 | /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, | 75 | /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, |
| 76 | plus 1 for any connection(s) we are `master' for */ | 76 | * plus 1 for any connection(s) we are `master' for |
| 77 | * | ||
| 78 | * Hint, SKB address this struct and refcnt via skb->nfct and | ||
| 79 | * helpers nf_conntrack_get() and nf_conntrack_put(). | ||
| 80 | * Helper nf_ct_put() equals nf_conntrack_put() by dec refcnt, | ||
| 81 | * beware nf_ct_get() is different and don't inc refcnt. | ||
| 82 | */ | ||
| 77 | struct nf_conntrack ct_general; | 83 | struct nf_conntrack ct_general; |
| 78 | 84 | ||
| 79 | spinlock_t lock; | 85 | spinlock_t lock; |
| 86 | u16 cpu; | ||
| 80 | 87 | ||
| 81 | /* XXX should I move this to the tail ? - Y.K */ | 88 | /* XXX should I move this to the tail ? - Y.K */ |
| 82 | /* These are my tuples; original and reply */ | 89 | /* These are my tuples; original and reply */ |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index 15308b8eb5b5..cc0c18827602 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
| @@ -77,6 +77,13 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, | |||
| 77 | const struct nf_conntrack_l3proto *l3proto, | 77 | const struct nf_conntrack_l3proto *l3proto, |
| 78 | const struct nf_conntrack_l4proto *proto); | 78 | const struct nf_conntrack_l4proto *proto); |
| 79 | 79 | ||
| 80 | extern spinlock_t nf_conntrack_lock ; | 80 | #ifdef CONFIG_LOCKDEP |
| 81 | # define CONNTRACK_LOCKS 8 | ||
| 82 | #else | ||
| 83 | # define CONNTRACK_LOCKS 1024 | ||
| 84 | #endif | ||
| 85 | extern spinlock_t nf_conntrack_locks[CONNTRACK_LOCKS]; | ||
| 86 | |||
| 87 | extern spinlock_t nf_conntrack_expect_lock; | ||
| 81 | 88 | ||
| 82 | #endif /* _NF_CONNTRACK_CORE_H */ | 89 | #endif /* _NF_CONNTRACK_CORE_H */ |
diff --git a/include/net/netfilter/nf_conntrack_labels.h b/include/net/netfilter/nf_conntrack_labels.h index c985695283b3..dec6336bf850 100644 --- a/include/net/netfilter/nf_conntrack_labels.h +++ b/include/net/netfilter/nf_conntrack_labels.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | #include <uapi/linux/netfilter/xt_connlabel.h> | 8 | #include <uapi/linux/netfilter/xt_connlabel.h> |
| 9 | 9 | ||
| 10 | #define NF_CT_LABELS_MAX_SIZE ((XT_CONNLABEL_MAXBIT + 1) / BITS_PER_BYTE) | ||
| 11 | |||
| 10 | struct nf_conn_labels { | 12 | struct nf_conn_labels { |
| 11 | u8 words; | 13 | u8 words; |
| 12 | unsigned long bits[]; | 14 | unsigned long bits[]; |
| @@ -29,7 +31,7 @@ static inline struct nf_conn_labels *nf_ct_labels_ext_add(struct nf_conn *ct) | |||
| 29 | u8 words; | 31 | u8 words; |
| 30 | 32 | ||
| 31 | words = ACCESS_ONCE(net->ct.label_words); | 33 | words = ACCESS_ONCE(net->ct.label_words); |
| 32 | if (words == 0 || WARN_ON_ONCE(words > 8)) | 34 | if (words == 0) |
| 33 | return NULL; | 35 | return NULL; |
| 34 | 36 | ||
| 35 | cl_ext = nf_ct_ext_add_length(ct, NF_CT_EXT_LABELS, | 37 | cl_ext = nf_ct_ext_add_length(ct, NF_CT_EXT_LABELS, |
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index e7e14ffe0f6a..e6bc14d8fa9a 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
| 5 | #include <linux/netfilter.h> | 5 | #include <linux/netfilter.h> |
| 6 | #include <linux/netfilter/nfnetlink.h> | ||
| 6 | #include <linux/netfilter/x_tables.h> | 7 | #include <linux/netfilter/x_tables.h> |
| 7 | #include <linux/netfilter/nf_tables.h> | 8 | #include <linux/netfilter/nf_tables.h> |
| 8 | #include <net/netlink.h> | 9 | #include <net/netlink.h> |
| @@ -288,7 +289,8 @@ struct nft_expr_ops { | |||
| 288 | int (*init)(const struct nft_ctx *ctx, | 289 | int (*init)(const struct nft_ctx *ctx, |
| 289 | const struct nft_expr *expr, | 290 | const struct nft_expr *expr, |
| 290 | const struct nlattr * const tb[]); | 291 | const struct nlattr * const tb[]); |
| 291 | void (*destroy)(const struct nft_expr *expr); | 292 | void (*destroy)(const struct nft_ctx *ctx, |
| 293 | const struct nft_expr *expr); | ||
| 292 | int (*dump)(struct sk_buff *skb, | 294 | int (*dump)(struct sk_buff *skb, |
| 293 | const struct nft_expr *expr); | 295 | const struct nft_expr *expr); |
| 294 | int (*validate)(const struct nft_ctx *ctx, | 296 | int (*validate)(const struct nft_ctx *ctx, |
| @@ -325,13 +327,15 @@ static inline void *nft_expr_priv(const struct nft_expr *expr) | |||
| 325 | * @handle: rule handle | 327 | * @handle: rule handle |
| 326 | * @genmask: generation mask | 328 | * @genmask: generation mask |
| 327 | * @dlen: length of expression data | 329 | * @dlen: length of expression data |
| 330 | * @ulen: length of user data (used for comments) | ||
| 328 | * @data: expression data | 331 | * @data: expression data |
| 329 | */ | 332 | */ |
| 330 | struct nft_rule { | 333 | struct nft_rule { |
| 331 | struct list_head list; | 334 | struct list_head list; |
| 332 | u64 handle:46, | 335 | u64 handle:42, |
| 333 | genmask:2, | 336 | genmask:2, |
| 334 | dlen:16; | 337 | dlen:12, |
| 338 | ulen:8; | ||
| 335 | unsigned char data[] | 339 | unsigned char data[] |
| 336 | __attribute__((aligned(__alignof__(struct nft_expr)))); | 340 | __attribute__((aligned(__alignof__(struct nft_expr)))); |
| 337 | }; | 341 | }; |
| @@ -340,19 +344,13 @@ struct nft_rule { | |||
| 340 | * struct nft_rule_trans - nf_tables rule update in transaction | 344 | * struct nft_rule_trans - nf_tables rule update in transaction |
| 341 | * | 345 | * |
| 342 | * @list: used internally | 346 | * @list: used internally |
| 347 | * @ctx: rule context | ||
| 343 | * @rule: rule that needs to be updated | 348 | * @rule: rule that needs to be updated |
| 344 | * @chain: chain that this rule belongs to | ||
| 345 | * @table: table for which this chain applies | ||
| 346 | * @nlh: netlink header of the message that contain this update | ||
| 347 | * @family: family expressesed as AF_* | ||
| 348 | */ | 349 | */ |
| 349 | struct nft_rule_trans { | 350 | struct nft_rule_trans { |
| 350 | struct list_head list; | 351 | struct list_head list; |
| 352 | struct nft_ctx ctx; | ||
| 351 | struct nft_rule *rule; | 353 | struct nft_rule *rule; |
| 352 | const struct nft_chain *chain; | ||
| 353 | const struct nft_table *table; | ||
| 354 | const struct nlmsghdr *nlh; | ||
| 355 | u8 family; | ||
| 356 | }; | 354 | }; |
| 357 | 355 | ||
| 358 | static inline struct nft_expr *nft_expr_first(const struct nft_rule *rule) | 356 | static inline struct nft_expr *nft_expr_first(const struct nft_rule *rule) |
| @@ -370,6 +368,11 @@ static inline struct nft_expr *nft_expr_last(const struct nft_rule *rule) | |||
| 370 | return (struct nft_expr *)&rule->data[rule->dlen]; | 368 | return (struct nft_expr *)&rule->data[rule->dlen]; |
| 371 | } | 369 | } |
| 372 | 370 | ||
| 371 | static inline void *nft_userdata(const struct nft_rule *rule) | ||
| 372 | { | ||
| 373 | return (void *)&rule->data[rule->dlen]; | ||
| 374 | } | ||
| 375 | |||
| 373 | /* | 376 | /* |
| 374 | * The last pointer isn't really necessary, but the compiler isn't able to | 377 | * The last pointer isn't really necessary, but the compiler isn't able to |
| 375 | * determine that the result of nft_expr_last() is always the same since it | 378 | * determine that the result of nft_expr_last() is always the same since it |
| @@ -521,6 +524,9 @@ void nft_unregister_chain_type(const struct nf_chain_type *); | |||
| 521 | int nft_register_expr(struct nft_expr_type *); | 524 | int nft_register_expr(struct nft_expr_type *); |
| 522 | void nft_unregister_expr(struct nft_expr_type *); | 525 | void nft_unregister_expr(struct nft_expr_type *); |
| 523 | 526 | ||
| 527 | #define nft_dereference(p) \ | ||
| 528 | nfnl_dereference(p, NFNL_SUBSYS_NFTABLES) | ||
| 529 | |||
| 524 | #define MODULE_ALIAS_NFT_FAMILY(family) \ | 530 | #define MODULE_ALIAS_NFT_FAMILY(family) \ |
| 525 | MODULE_ALIAS("nft-afinfo-" __stringify(family)) | 531 | MODULE_ALIAS("nft-afinfo-" __stringify(family)) |
| 526 | 532 | ||
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index fbcc7fa536dc..773cce308bc6 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/list_nulls.h> | 5 | #include <linux/list_nulls.h> |
| 6 | #include <linux/atomic.h> | 6 | #include <linux/atomic.h> |
| 7 | #include <linux/netfilter/nf_conntrack_tcp.h> | 7 | #include <linux/netfilter/nf_conntrack_tcp.h> |
| 8 | #include <linux/seqlock.h> | ||
| 8 | 9 | ||
| 9 | struct ctl_table_header; | 10 | struct ctl_table_header; |
| 10 | struct nf_conntrack_ecache; | 11 | struct nf_conntrack_ecache; |
| @@ -62,6 +63,13 @@ struct nf_ip_net { | |||
| 62 | #endif | 63 | #endif |
| 63 | }; | 64 | }; |
| 64 | 65 | ||
| 66 | struct ct_pcpu { | ||
| 67 | spinlock_t lock; | ||
| 68 | struct hlist_nulls_head unconfirmed; | ||
| 69 | struct hlist_nulls_head dying; | ||
| 70 | struct hlist_nulls_head tmpl; | ||
| 71 | }; | ||
| 72 | |||
| 65 | struct netns_ct { | 73 | struct netns_ct { |
| 66 | atomic_t count; | 74 | atomic_t count; |
| 67 | unsigned int expect_count; | 75 | unsigned int expect_count; |
| @@ -83,12 +91,11 @@ struct netns_ct { | |||
| 83 | int sysctl_checksum; | 91 | int sysctl_checksum; |
| 84 | 92 | ||
| 85 | unsigned int htable_size; | 93 | unsigned int htable_size; |
| 94 | seqcount_t generation; | ||
| 86 | struct kmem_cache *nf_conntrack_cachep; | 95 | struct kmem_cache *nf_conntrack_cachep; |
| 87 | struct hlist_nulls_head *hash; | 96 | struct hlist_nulls_head *hash; |
| 88 | struct hlist_head *expect_hash; | 97 | struct hlist_head *expect_hash; |
| 89 | struct hlist_nulls_head unconfirmed; | 98 | struct ct_pcpu __percpu *pcpu_lists; |
| 90 | struct hlist_nulls_head dying; | ||
| 91 | struct hlist_nulls_head tmpl; | ||
| 92 | struct ip_conntrack_stat __percpu *stat; | 99 | struct ip_conntrack_stat __percpu *stat; |
| 93 | struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; | 100 | struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; |
| 94 | struct nf_exp_event_notifier __rcu *nf_expect_event_cb; | 101 | struct nf_exp_event_notifier __rcu *nf_expect_event_cb; |
diff --git a/include/uapi/linux/netfilter/ipset/ip_set.h b/include/uapi/linux/netfilter/ipset/ip_set.h index 25d3b2f79c02..78c2f2e79920 100644 --- a/include/uapi/linux/netfilter/ipset/ip_set.h +++ b/include/uapi/linux/netfilter/ipset/ip_set.h | |||
| @@ -82,6 +82,8 @@ enum { | |||
| 82 | IPSET_ATTR_PROTO, /* 7 */ | 82 | IPSET_ATTR_PROTO, /* 7 */ |
| 83 | IPSET_ATTR_CADT_FLAGS, /* 8 */ | 83 | IPSET_ATTR_CADT_FLAGS, /* 8 */ |
| 84 | IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */ | 84 | IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */ |
| 85 | IPSET_ATTR_MARK, /* 10 */ | ||
| 86 | IPSET_ATTR_MARKMASK, /* 11 */ | ||
| 85 | /* Reserve empty slots */ | 87 | /* Reserve empty slots */ |
| 86 | IPSET_ATTR_CADT_MAX = 16, | 88 | IPSET_ATTR_CADT_MAX = 16, |
| 87 | /* Create-only specific attributes */ | 89 | /* Create-only specific attributes */ |
| @@ -144,6 +146,7 @@ enum ipset_errno { | |||
| 144 | IPSET_ERR_IPADDR_IPV6, | 146 | IPSET_ERR_IPADDR_IPV6, |
| 145 | IPSET_ERR_COUNTER, | 147 | IPSET_ERR_COUNTER, |
| 146 | IPSET_ERR_COMMENT, | 148 | IPSET_ERR_COMMENT, |
| 149 | IPSET_ERR_INVALID_MARKMASK, | ||
| 147 | 150 | ||
| 148 | /* Type specific error codes */ | 151 | /* Type specific error codes */ |
| 149 | IPSET_ERR_TYPE_SPECIFIC = 4352, | 152 | IPSET_ERR_TYPE_SPECIFIC = 4352, |
| @@ -182,9 +185,18 @@ enum ipset_cadt_flags { | |||
| 182 | IPSET_FLAG_WITH_COUNTERS = (1 << IPSET_FLAG_BIT_WITH_COUNTERS), | 185 | IPSET_FLAG_WITH_COUNTERS = (1 << IPSET_FLAG_BIT_WITH_COUNTERS), |
| 183 | IPSET_FLAG_BIT_WITH_COMMENT = 4, | 186 | IPSET_FLAG_BIT_WITH_COMMENT = 4, |
| 184 | IPSET_FLAG_WITH_COMMENT = (1 << IPSET_FLAG_BIT_WITH_COMMENT), | 187 | IPSET_FLAG_WITH_COMMENT = (1 << IPSET_FLAG_BIT_WITH_COMMENT), |
| 188 | IPSET_FLAG_BIT_WITH_FORCEADD = 5, | ||
| 189 | IPSET_FLAG_WITH_FORCEADD = (1 << IPSET_FLAG_BIT_WITH_FORCEADD), | ||
| 185 | IPSET_FLAG_CADT_MAX = 15, | 190 | IPSET_FLAG_CADT_MAX = 15, |
| 186 | }; | 191 | }; |
| 187 | 192 | ||
| 193 | /* The flag bits which correspond to the non-extension create flags */ | ||
| 194 | enum ipset_create_flags { | ||
| 195 | IPSET_CREATE_FLAG_BIT_FORCEADD = 0, | ||
| 196 | IPSET_CREATE_FLAG_FORCEADD = (1 << IPSET_CREATE_FLAG_BIT_FORCEADD), | ||
| 197 | IPSET_CREATE_FLAG_BIT_MAX = 7, | ||
| 198 | }; | ||
| 199 | |||
| 188 | /* Commands with settype-specific attributes */ | 200 | /* Commands with settype-specific attributes */ |
| 189 | enum ipset_adt { | 201 | enum ipset_adt { |
| 190 | IPSET_ADD, | 202 | IPSET_ADD, |
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h index 83c985a6170b..c88ccbfda5f1 100644 --- a/include/uapi/linux/netfilter/nf_tables.h +++ b/include/uapi/linux/netfilter/nf_tables.h | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #ifndef _LINUX_NF_TABLES_H | 1 | #ifndef _LINUX_NF_TABLES_H |
| 2 | #define _LINUX_NF_TABLES_H | 2 | #define _LINUX_NF_TABLES_H |
| 3 | 3 | ||
| 4 | #define NFT_CHAIN_MAXNAMELEN 32 | 4 | #define NFT_CHAIN_MAXNAMELEN 32 |
| 5 | #define NFT_USERDATA_MAXLEN 256 | ||
| 5 | 6 | ||
| 6 | enum nft_registers { | 7 | enum nft_registers { |
| 7 | NFT_REG_VERDICT, | 8 | NFT_REG_VERDICT, |
| @@ -156,6 +157,7 @@ enum nft_chain_attributes { | |||
| 156 | * @NFTA_RULE_EXPRESSIONS: list of expressions (NLA_NESTED: nft_expr_attributes) | 157 | * @NFTA_RULE_EXPRESSIONS: list of expressions (NLA_NESTED: nft_expr_attributes) |
| 157 | * @NFTA_RULE_COMPAT: compatibility specifications of the rule (NLA_NESTED: nft_rule_compat_attributes) | 158 | * @NFTA_RULE_COMPAT: compatibility specifications of the rule (NLA_NESTED: nft_rule_compat_attributes) |
| 158 | * @NFTA_RULE_POSITION: numeric handle of the previous rule (NLA_U64) | 159 | * @NFTA_RULE_POSITION: numeric handle of the previous rule (NLA_U64) |
| 160 | * @NFTA_RULE_USERDATA: user data (NLA_BINARY, NFT_USERDATA_MAXLEN) | ||
| 159 | */ | 161 | */ |
| 160 | enum nft_rule_attributes { | 162 | enum nft_rule_attributes { |
| 161 | NFTA_RULE_UNSPEC, | 163 | NFTA_RULE_UNSPEC, |
| @@ -165,6 +167,7 @@ enum nft_rule_attributes { | |||
| 165 | NFTA_RULE_EXPRESSIONS, | 167 | NFTA_RULE_EXPRESSIONS, |
| 166 | NFTA_RULE_COMPAT, | 168 | NFTA_RULE_COMPAT, |
| 167 | NFTA_RULE_POSITION, | 169 | NFTA_RULE_POSITION, |
| 170 | NFTA_RULE_USERDATA, | ||
| 168 | __NFTA_RULE_MAX | 171 | __NFTA_RULE_MAX |
| 169 | }; | 172 | }; |
| 170 | #define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1) | 173 | #define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1) |
| @@ -601,6 +604,7 @@ enum nft_ct_keys { | |||
| 601 | NFT_CT_PROTOCOL, | 604 | NFT_CT_PROTOCOL, |
| 602 | NFT_CT_PROTO_SRC, | 605 | NFT_CT_PROTO_SRC, |
| 603 | NFT_CT_PROTO_DST, | 606 | NFT_CT_PROTO_DST, |
| 607 | NFT_CT_LABELS, | ||
| 604 | }; | 608 | }; |
| 605 | 609 | ||
| 606 | /** | 610 | /** |
