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> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
ae6134bdf3
commit
0dbff689c2
@@ -240,12 +240,12 @@ get_unique_tuple(struct nf_conntrack_tuple *tuple,
|
|||||||
This is only required for source (ie. NAT/masq) mappings.
|
This is only required for source (ie. NAT/masq) mappings.
|
||||||
So far, we don't do local source mappings, so multiple
|
So far, we don't do local source mappings, so multiple
|
||||||
manips not an issue. */
|
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)) {
|
if (find_appropriate_src(orig_tuple, tuple, range)) {
|
||||||
pr_debug("get_unique_tuple: Found current src map\n");
|
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))
|
||||||
if (!nf_nat_used_tuple(tuple, ct))
|
return;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user