Skip to content

Commit 75c2631

Browse files
Florian Westphalummakynes
authored andcommitted
netfilter: nf_nat: don't bug when mapping already exists
It seems preferrable to limp along if we have a conflicting mapping, its certainly better than a BUG(). Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 68913a0 commit 75c2631

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/netfilter/nf_nat_core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,9 @@ nf_nat_setup_info(struct nf_conn *ct,
416416

417417
WARN_ON(maniptype != NF_NAT_MANIP_SRC &&
418418
maniptype != NF_NAT_MANIP_DST);
419-
BUG_ON(nf_nat_initialized(ct, maniptype));
419+
420+
if (WARN_ON(nf_nat_initialized(ct, maniptype)))
421+
return NF_DROP;
420422

421423
/* What we've got will look like inverse of reply. Normally
422424
* this is what is in the conntrack, except for prior

0 commit comments

Comments
 (0)