From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 3/9] netfilter: nf_nat: don't bug when mapping already exists
Date: Fri, 8 Sep 2017 19:45:42 +0200 [thread overview]
Message-ID: <1504892748-1605-4-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1504892748-1605-1-git-send-email-pablo@netfilter.org>
From: Florian Westphal <fw@strlen.de>
It seems preferrable to limp along if we have a conflicting mapping,
its certainly better than a BUG().
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nf_nat_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c
index 40573aa6c133..dc3519cc7209 100644
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
@@ -416,7 +416,9 @@ nf_nat_setup_info(struct nf_conn *ct,
WARN_ON(maniptype != NF_NAT_MANIP_SRC &&
maniptype != NF_NAT_MANIP_DST);
- BUG_ON(nf_nat_initialized(ct, maniptype));
+
+ if (WARN_ON(nf_nat_initialized(ct, maniptype)))
+ return NF_DROP;
/* What we've got will look like inverse of reply. Normally
* this is what is in the conntrack, except for prior
--
2.1.4
next prev parent reply other threads:[~2017-09-08 17:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-08 17:45 [PATCH 0/9] Netfilter/IPVS fixes for net Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 1/9] netfilter: ipvs: fix the issue that sctp_conn_schedule drops non-INIT packet Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 2/9] netfilter: ipvs: do not create conn for ABORT packet in sctp_conn_schedule Pablo Neira Ayuso
2017-09-08 17:45 ` Pablo Neira Ayuso [this message]
2017-09-08 17:45 ` [PATCH 4/9] netfilter: xtables: add scheduling opportunity in get_counters Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 5/9] netfilter: nat: Revert "netfilter: nat: convert nat bysrc hash to rhashtable" Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 6/9] netfilter: nat: use keyed locks Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 7/9] netfilter: core: remove erroneous warn_on Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 8/9] netfilter: xt_hashlimit: alloc hashtable with right size Pablo Neira Ayuso
2017-09-08 17:45 ` [PATCH 9/9] netfilter: xt_hashlimit: fix build error caused by 64bit division Pablo Neira Ayuso
2017-09-08 18:36 ` [PATCH 0/9] Netfilter/IPVS fixes for net David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504892748-1605-4-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).