Commit 7025bac4 authored by Gao Feng's avatar Gao Feng Committed by Pablo Neira Ayuso

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: default avatarGao Feng <fgao@ikuai8.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent a702ece3
...@@ -806,7 +806,7 @@ nfnetlink_parse_nat_setup(struct nf_conn *ct, ...@@ -806,7 +806,7 @@ nfnetlink_parse_nat_setup(struct nf_conn *ct,
/* No NAT information has been passed, allocate the null-binding */ /* No NAT information has been passed, allocate the null-binding */
if (attr == NULL) 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); err = nfnetlink_parse_nat(attr, ct, &range, l3proto);
if (err < 0) if (err < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment