]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
netfilter: nf_nat_core: eliminate useless find_appropriate_src for IP_NAT_RANGE_PROTO...
authorChangli Gao <xiaosuo@gmail.com>
Mon, 21 Jul 2008 17:00:51 +0000 (10:00 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jul 2008 17:10:57 +0000 (10:10 -0700)
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/nf_nat_core.c

index d2a887fc8d9b1b53f1539bcfc8c446d248466522..6c6a3cba8d50eab5b32f359e576c34a73ee76697 100644 (file)
@@ -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;
                }
        }