summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGao Feng <fgao@ikuai8.com>2017-04-12 12:33:03 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-04-15 11:04:14 +0200
commit7025bac47fba90cb39a53c011ee78f7f66d72793 (patch)
tree52f749fdede74d3df5c3d05a46a1ff8513ba34b0 /net
parentMerge tag 'ipvs2-for-v4.12' of https://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
downloadlinux-7025bac47fba90cb39a53c011ee78f7f66d72793.tar.xz
linux-7025bac47fba90cb39a53c011ee78f7f66d72793.zip
netfilter: nf_nat: Fix return NF_DROP in nfnetlink_parse_nat_setup
The __nf_nat_alloc_null_binding invokes nf_nat_setup_info which may return NF_DROP when memory is exhausted, so convert NF_DROP to -ENOMEM to make ctnetlink happy. Or ctnetlink_setup_nat treats it as a success when one error NF_DROP happens actully. Signed-off-by: Gao Feng <fgao@ikuai8.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_nat_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c
index fb0e65411785..5e35643da650 100644
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
@@ -806,7 +806,7 @@ nfnetlink_parse_nat_setup(struct nf_conn *ct,
/* No NAT information has been passed, allocate the null-binding */
if (attr == NULL)
- return __nf_nat_alloc_null_binding(ct, manip);
+ return __nf_nat_alloc_null_binding(ct, manip) == NF_DROP ? -ENOMEM : 0;
err = nfnetlink_parse_nat(attr, ct, &range, l3proto);
if (err < 0)