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/linux | |
| 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/linux')
| -rw-r--r-- | include/linux/netfilter/ipset/ip_set.h | 15 | ||||
| -rw-r--r-- | include/linux/netfilter/nfnetlink.h | 21 |
2 files changed, 32 insertions, 4 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)) |
