Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26791
b: refs/heads/master
c: a467704
h: refs/heads/master
i:
  26789: cd2f26f
  26787: c99e475
  26783: 3f03816
v: v3
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed May 19, 2006
1 parent d826f4b commit 2163552
Show file tree
Hide file tree
Showing 2 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: 5c170a09d9092e63af1658179f29867d32d56b55
refs/heads/master: a467704dcb4fa45da48079486f1b0e6baffb12d2
12 changes: 6 additions & 6 deletions trunk/net/ipv4/netfilter/ip_nat_proto_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ gre_in_range(const struct ip_conntrack_tuple *tuple,
const union ip_conntrack_manip_proto *min,
const union ip_conntrack_manip_proto *max)
{
u_int32_t key;
__be16 key;

if (maniptype == IP_NAT_MANIP_SRC)
key = tuple->src.u.gre.key;
else
key = tuple->dst.u.gre.key;

return ntohl(key) >= ntohl(min->gre.key)
&& ntohl(key) <= ntohl(max->gre.key);
return ntohs(key) >= ntohs(min->gre.key)
&& ntohs(key) <= ntohs(max->gre.key);
}

/* generate unique tuple ... */
Expand All @@ -81,14 +81,14 @@ gre_unique_tuple(struct ip_conntrack_tuple *tuple,
min = 1;
range_size = 0xffff;
} else {
min = ntohl(range->min.gre.key);
range_size = ntohl(range->max.gre.key) - min + 1;
min = ntohs(range->min.gre.key);
range_size = ntohs(range->max.gre.key) - min + 1;
}

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

for (i = 0; i < range_size; i++, key++) {
*keyptr = htonl(min + key % range_size);
*keyptr = htons(min + key % range_size);
if (!ip_nat_used_tuple(tuple, conntrack))
return 1;
}
Expand Down

0 comments on commit 2163552

Please sign in to comment.