提交 122ebbf2 编写于 作者: J Jozsef Kadlecsik

netfilter: ipset: Don't call ip_nest_end needlessly in the error path

Suggested-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
上级 7722e0d1
...@@ -228,11 +228,11 @@ mtype_list(const struct ip_set *set, ...@@ -228,11 +228,11 @@ mtype_list(const struct ip_set *set,
nla_put_failure: nla_put_failure:
nla_nest_cancel(skb, nested); nla_nest_cancel(skb, nested);
ipset_nest_end(skb, adt);
if (unlikely(id == first)) { if (unlikely(id == first)) {
cb->args[2] = 0; cb->args[2] = 0;
return -EMSGSIZE; return -EMSGSIZE;
} }
ipset_nest_end(skb, adt);
return 0; return 0;
} }
......
...@@ -909,13 +909,13 @@ mtype_list(const struct ip_set *set, ...@@ -909,13 +909,13 @@ mtype_list(const struct ip_set *set,
nla_put_failure: nla_put_failure:
nlmsg_trim(skb, incomplete); nlmsg_trim(skb, incomplete);
ipset_nest_end(skb, atd);
if (unlikely(first == cb->args[2])) { if (unlikely(first == cb->args[2])) {
pr_warning("Can't list set %s: one bucket does not fit into " pr_warning("Can't list set %s: one bucket does not fit into "
"a message. Please report it!\n", set->name); "a message. Please report it!\n", set->name);
cb->args[2] = 0; cb->args[2] = 0;
return -EMSGSIZE; return -EMSGSIZE;
} }
ipset_nest_end(skb, atd);
return 0; return 0;
} }
......
...@@ -550,11 +550,11 @@ list_set_list(const struct ip_set *set, ...@@ -550,11 +550,11 @@ list_set_list(const struct ip_set *set,
nla_put_failure: nla_put_failure:
nla_nest_cancel(skb, nested); nla_nest_cancel(skb, nested);
ipset_nest_end(skb, atd);
if (unlikely(i == first)) { if (unlikely(i == first)) {
cb->args[2] = 0; cb->args[2] = 0;
return -EMSGSIZE; return -EMSGSIZE;
} }
ipset_nest_end(skb, atd);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册