提交 6aec2087 编写于 作者: Y Yi-Hung Wei 提交者: Pablo Neira Ayuso

netfilter: Refactor nf_conncount

Remove parameter 'family' in nf_conncount_count() and count_tree().
It is because the parameter is not useful after commit 625c5561
("netfilter: connlimit: split xt_connlimit into front and backend").
Signed-off-by: NYi-Hung Wei <yihung.wei@gmail.com>
Acked-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 a55efe1d
...@@ -11,7 +11,6 @@ void nf_conncount_destroy(struct net *net, unsigned int family, ...@@ -11,7 +11,6 @@ void nf_conncount_destroy(struct net *net, unsigned int family,
unsigned int nf_conncount_count(struct net *net, unsigned int nf_conncount_count(struct net *net,
struct nf_conncount_data *data, struct nf_conncount_data *data,
const u32 *key, const u32 *key,
unsigned int family,
const struct nf_conntrack_tuple *tuple, const struct nf_conntrack_tuple *tuple,
const struct nf_conntrack_zone *zone); const struct nf_conntrack_zone *zone);
#endif #endif
...@@ -158,7 +158,6 @@ static void tree_nodes_free(struct rb_root *root, ...@@ -158,7 +158,6 @@ static void tree_nodes_free(struct rb_root *root,
static unsigned int static unsigned int
count_tree(struct net *net, struct rb_root *root, count_tree(struct net *net, struct rb_root *root,
const u32 *key, u8 keylen, const u32 *key, u8 keylen,
u8 family,
const struct nf_conntrack_tuple *tuple, const struct nf_conntrack_tuple *tuple,
const struct nf_conntrack_zone *zone) const struct nf_conntrack_zone *zone)
{ {
...@@ -246,7 +245,6 @@ count_tree(struct net *net, struct rb_root *root, ...@@ -246,7 +245,6 @@ count_tree(struct net *net, struct rb_root *root,
unsigned int nf_conncount_count(struct net *net, unsigned int nf_conncount_count(struct net *net,
struct nf_conncount_data *data, struct nf_conncount_data *data,
const u32 *key, const u32 *key,
unsigned int family,
const struct nf_conntrack_tuple *tuple, const struct nf_conntrack_tuple *tuple,
const struct nf_conntrack_zone *zone) const struct nf_conntrack_zone *zone)
{ {
...@@ -259,7 +257,7 @@ unsigned int nf_conncount_count(struct net *net, ...@@ -259,7 +257,7 @@ unsigned int nf_conncount_count(struct net *net,
spin_lock_bh(&nf_conncount_locks[hash % CONNCOUNT_LOCK_SLOTS]); spin_lock_bh(&nf_conncount_locks[hash % CONNCOUNT_LOCK_SLOTS]);
count = count_tree(net, root, key, data->keylen, family, tuple, zone); count = count_tree(net, root, key, data->keylen, tuple, zone);
spin_unlock_bh(&nf_conncount_locks[hash % CONNCOUNT_LOCK_SLOTS]); spin_unlock_bh(&nf_conncount_locks[hash % CONNCOUNT_LOCK_SLOTS]);
......
...@@ -67,8 +67,8 @@ connlimit_mt(const struct sk_buff *skb, struct xt_action_param *par) ...@@ -67,8 +67,8 @@ connlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
key[1] = zone->id; key[1] = zone->id;
} }
connections = nf_conncount_count(net, info->data, key, connections = nf_conncount_count(net, info->data, key, tuple_ptr,
xt_family(par), tuple_ptr, zone); zone);
if (connections == 0) if (connections == 0)
/* kmalloc failed, drop it entirely */ /* kmalloc failed, drop it entirely */
goto hotdrop; goto hotdrop;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册