[PATCH nf-next v4 10/13] netfilter: ipset: remove resize completely

Florian Westphal <[email protected]>
Newsgroups gmane.comp.security.firewalls.netfilter.devel
Message-ID <[email protected]>
From: Jozsef Kadlecsik <[email protected]>

It is not needed anymore.

Signed-off-by: Jozsef Kadlecsik <[email protected]>
Signed-off-by: Florian Westphal <[email protected]>
---
 include/linux/netfilter/ipset/ip_set.h | 2 --
 net/netfilter/ipset/ip_set_core.c      | 5 +----
 net/netfilter/ipset/ip_set_hash_gen.h  | 1 -
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 37cfda517c1b..9a0a2944700b 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -166,8 +166,6 @@ struct ip_set_type_variant {
 	/* Low level add/del/test functions */
 	ipset_adtfn adt[IPSET_ADT_MAX];
 
-	/* When adding entries and set is full, try to resize the set */
-	int (*resize)(struct ip_set *set, bool retried);
 	/* Destroy the set */
 	void (*destroy)(struct ip_set *set);
 	/* Flush the elements */
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 339726b33342..f1378e9540a1 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -1744,10 +1744,7 @@ call_ad(struct net *net, struct sock *ctnl, struct sk_buff *skb,
 
 		ret = set->variant->uadt(set, tb, adt, &lineno, flags, retried);
 		retried = true;
-	} while (ret == -ERANGE ||
-		 (ret == -EAGAIN &&
-		  set->variant->resize &&
-		  (ret = set->variant->resize(set, retried)) == 0));
+	} while (ret == -ERANGE);
 
 	if (!ret || (ret == -IPSET_ERR_EXIST && eexist))
 		return 0;
diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h
index 973adb854082..225f30e5b749 100644
--- a/net/netfilter/ipset/ip_set_hash_gen.h
+++ b/net/netfilter/ipset/ip_set_hash_gen.h
@@ -1302,7 +1302,6 @@ static const struct ip_set_type_variant mtype_variant = {
 	.head	= mtype_head,
 	.list	= mtype_list,
 	.uref	= mtype_uref,
-	.resize	= NULL,
 	.same_set = mtype_same_set,
 	.cancel_gc = mtype_cancel_gc,
 };
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.