Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203987
b: refs/heads/master
c: 2452a99
h: refs/heads/master
i:
  203985: e1d9c9c
  203983: f16171d
v: v3
  • Loading branch information
Changli Gao authored and Patrick McHardy committed Aug 2, 2010
1 parent 0cec32a commit 27dd165
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f43dc98b3be36551143e3bbaf1bb3067835c24f4
refs/heads/master: 2452a99dc0496a90abd0090c280671370c0f3e1c
4 changes: 2 additions & 2 deletions trunk/net/ipv4/netfilter/nf_nat_proto_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ void nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple,
else
off = *rover;

for (i = 0; i < range_size; i++, off++) {
for (i = 0; ; ++off) {
*portptr = htons(min + off % range_size);
if (nf_nat_used_tuple(tuple, ct))
if (++i != range_size && nf_nat_used_tuple(tuple, ct))
continue;
if (!(range->flags & IP_NAT_RANGE_PROTO_RANDOM))
*rover = off;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/netfilter/nf_nat_proto_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,

pr_debug("min = %u, range_size = %u\n", min, range_size);

for (i = 0; i < range_size; i++, key++) {
for (i = 0; ; ++key) {
*keyptr = htons(min + key % range_size);
if (!nf_nat_used_tuple(tuple, ct))
if (++i == range_size || !nf_nat_used_tuple(tuple, ct))
return;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/netfilter/nf_nat_proto_icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ icmp_unique_tuple(struct nf_conntrack_tuple *tuple,
if (!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED))
range_size = 0xFFFF;

for (i = 0; i < range_size; i++, id++) {
for (i = 0; ; ++id) {
tuple->src.u.icmp.id = htons(ntohs(range->min.icmp.id) +
(id % range_size));
if (!nf_nat_used_tuple(tuple, ct))
if (++i == range_size || !nf_nat_used_tuple(tuple, ct))
return;
}
return;
Expand Down

0 comments on commit 27dd165

Please sign in to comment.