Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4934
b: refs/heads/master
c: 74bb421
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jul 22, 2005
1 parent 4abe9a9 commit 014bf12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: 21f930e4abdcb9649f26e5b959c14dddee4e600b
refs/heads/master: 74bb421da7f39e70ab636ad46ef85ea1178786c5
7 changes: 4 additions & 3 deletions trunk/net/ipv4/netfilter/ip_nat_proto_icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ icmp_unique_tuple(struct ip_conntrack_tuple *tuple,
const struct ip_conntrack *conntrack)
{
static u_int16_t id;
unsigned int range_size
= (unsigned int)range->max.icmp.id - range->min.icmp.id + 1;
unsigned int range_size;
unsigned int i;

range_size = ntohs(range->max.icmp.id) - ntohs(range->min.icmp.id) + 1;
/* If no range specified... */
if (!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED))
range_size = 0xFFFF;

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

0 comments on commit 014bf12

Please sign in to comment.