Fwd: [PATCH] nf_nat_core: eliminate find_appropriate_src call if range is set IP_NAT_RANGE_PROTO_RANDOM bit on

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---------- Forwarded message ----------
From: Changli Gao <xiaosuo@xxxxxxxxx>
Date: 2008/6/30
Subject: [PATCH] nf_nat_core: eliminate find_appropriate_src call if
range is set IP_NAT_RANGE_PROTO_RANDOM bit on
To: netfilter-devel@xxxxxxxxxxxxxxxxxxx
Cc: Changli Gao <xiaosuo@xxxxxxxxx>


Eliminate find_appropriate_src call if range is set
IP_NAT_RANGE_PROTO_RANDOM bit on.

Signed-off-by: Changli Gao <xiaosuo@xxxxxxxxx>
---
 nf_nat_core.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- net/ipv4/netfilter/nf_nat_core.c.orig       2008-06-30
11:12:26.000000000 +0800
+++ net/ipv4/netfilter/nf_nat_core.c    2008-06-30 12:22:23.000000000 +0800
@@ -240,12 +240,12 @@
          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;
               }
       }

--
Regards,
Changli Gao(xiaosuo@xxxxxxxxx)



-- 
Regards,
Changli Gao(xiaosuo@xxxxxxxxx)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux