netfilter: ipset: Collapse same condition body to a single one
The set full case (with net_ratelimit()-ed pr_warn()) is already handled, simply jump there. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
This commit is contained in:
parent
21956ab290
commit
9be37d2acd
@ -719,14 +719,8 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext,
|
|||||||
key = HKEY(value, h->initval, t->htable_bits);
|
key = HKEY(value, h->initval, t->htable_bits);
|
||||||
n = __ipset_dereference_protected(hbucket(t, key), 1);
|
n = __ipset_dereference_protected(hbucket(t, key), 1);
|
||||||
if (!n) {
|
if (!n) {
|
||||||
if (forceadd) {
|
if (forceadd || set->elements >= h->maxelem)
|
||||||
if (net_ratelimit())
|
|
||||||
pr_warn("Set %s is full, maxelem %u reached\n",
|
|
||||||
set->name, h->maxelem);
|
|
||||||
return -IPSET_ERR_HASH_FULL;
|
|
||||||
} else if (set->elements >= h->maxelem) {
|
|
||||||
goto set_full;
|
goto set_full;
|
||||||
}
|
|
||||||
old = NULL;
|
old = NULL;
|
||||||
n = kzalloc(sizeof(*n) + AHASH_INIT_SIZE * set->dsize,
|
n = kzalloc(sizeof(*n) + AHASH_INIT_SIZE * set->dsize,
|
||||||
GFP_ATOMIC);
|
GFP_ATOMIC);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user