netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: Patrick McHardy <kaber@trash.net>, netfilter-devel@vger.kernel.org
Subject: netfilter 01/08: nf_nat_core: eliminate useless find_appropriate_src for IP_NAT_RANGE_PROTO_RANDOM
Date: Mon, 21 Jul 2008 18:17:24 +0200 (MEST)	[thread overview]
Message-ID: <20080721161724.28572.91589.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080721161722.28572.97957.sendpatchset@localhost.localdomain>

netfilter: nf_nat_core: eliminate useless find_appropriate_src for IP_NAT_RANGE_PROTO_RANDOM

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 7af3d4eb70fd3a310c56c7080d7d09fc64ddd6a7
tree 4c1d98c3e69cad567b624f8fde71bf0cc6d358e1
parent 3a682fbd732d3d27bec722a923952b0938e8a404
author Changli Gao <xiaosuo@gmail.com> Mon, 21 Jul 2008 16:25:17 +0200
committer Patrick McHardy <kaber@trash.net> Mon, 21 Jul 2008 16:25:17 +0200

 net/ipv4/netfilter/nf_nat_core.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index d2a887f..6c6a3cb 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -240,12 +240,12 @@ get_unique_tuple(struct nf_conntrack_tuple *tuple,
 	   This is only required for source (ie. NAT/masq) mappings.
 	   So far, we don't do local source mappings, so multiple
 	   manips not an issue.  */
-	if (maniptype == IP_NAT_MANIP_SRC) {
+	if (maniptype == IP_NAT_MANIP_SRC &&
+	    !(range->flags & IP_NAT_RANGE_PROTO_RANDOM)) {
 		if (find_appropriate_src(orig_tuple, tuple, range)) {
 			pr_debug("get_unique_tuple: Found current src map\n");
-			if (!(range->flags & IP_NAT_RANGE_PROTO_RANDOM))
-				if (!nf_nat_used_tuple(tuple, ct))
-					return;
+			if (!nf_nat_used_tuple(tuple, ct))
+				return;
 		}
 	}
 

  reply	other threads:[~2008-07-21 16:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 16:17 netfilter 00/08: Netfilter Update Patrick McHardy
2008-07-21 16:17 ` Patrick McHardy [this message]
2008-07-21 17:04   ` netfilter 01/08: nf_nat_core: eliminate useless find_appropriate_src for IP_NAT_RANGE_PROTO_RANDOM David Miller
2008-07-21 16:17 ` netlink 02/08: add NLA_PUT_BE64 macro Patrick McHardy
2008-07-21 17:05   ` David Miller
2008-07-21 16:17 ` netfilter 03/08: accounting rework: ct_extend + 64bit counters (v4) Patrick McHardy
2008-07-21 17:05   ` David Miller
2008-07-21 17:07     ` Patrick McHardy
2008-07-21 16:17 ` netfilter 04/08: xt_time: fix time's time_mt()'s use of do_div() Patrick McHardy
2008-07-21 17:05   ` David Miller
2008-07-21 16:17 ` netfilter 05/08: nfnetlink_log: send complete hardware header Patrick McHardy
2008-07-21 17:05   ` David Miller
2008-07-21 16:17 ` netfilter 06/08: xt_TCPMSS: collapse tcpmss_reverse_mtu{4,6} into one function Patrick McHardy
2008-07-21 17:06   ` David Miller
2008-07-21 16:17 ` netfilter 07/08: nf_nat_sip: c= is optional for session Patrick McHardy
2008-07-21 17:06   ` David Miller
2008-07-21 16:17 ` netfilter 08/08: nf_conntrack_sctp: fix sparse warnings Patrick McHardy
2008-07-21 17:06   ` 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=20080721161724.28572.91589.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --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).