tree f3db750e4983be81fa6a959d76e1d72eb6b4ec3f
parent 15d9ede619f2ec879fcb50a327e64ea92bb450a4
author Patrick McHardy <[EMAIL PROTECTED]> Mon, 01 Aug 2005 10:19:18 -0700
committer David S. Miller <[EMAIL PROTECTED]> Mon, 01 Aug 2005 10:19:18 -0700

[NETFILTER]: Use correct byteorder in ICMP NAT

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

 net/ipv4/netfilter/ip_nat_proto_icmp.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/netfilter/ip_nat_proto_icmp.c 
b/net/ipv4/netfilter/ip_nat_proto_icmp.c
--- a/net/ipv4/netfilter/ip_nat_proto_icmp.c
+++ b/net/ipv4/netfilter/ip_nat_proto_icmp.c
@@ -26,16 +26,17 @@ icmp_unique_tuple(struct ip_conntrack_tu
                  const struct ip_conntrack *conntrack)
 {
        static u_int16_t id = 0;
-       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;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-24" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to