]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/ip_nat_proto_icmp.c
[NETFILTER]: nf_nat: add SNMP NAT helper port
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / ip_nat_proto_icmp.c
index 31a3f4ccb99ccb39283d4ec5879dded31bc37464..fb716edd5bc6da555738c8eab0f6a5023d10a0bd 100644 (file)
@@ -24,8 +24,8 @@ icmp_in_range(const struct ip_conntrack_tuple *tuple,
              const union ip_conntrack_manip_proto *min,
              const union ip_conntrack_manip_proto *max)
 {
-       return (tuple->src.u.icmp.id >= min->icmp.id
-               && tuple->src.u.icmp.id <= max->icmp.id);
+       return ntohs(tuple->src.u.icmp.id) >= ntohs(min->icmp.id) &&
+              ntohs(tuple->src.u.icmp.id) <= ntohs(max->icmp.id);
 }
 
 static int
@@ -66,10 +66,8 @@ icmp_manip_pkt(struct sk_buff **pskb,
                return 0;
 
        hdr = (struct icmphdr *)((*pskb)->data + hdroff);
-
-       hdr->checksum = ip_nat_cheat_check(hdr->un.echo.id ^ 0xFFFF,
-                                           tuple->src.u.icmp.id,
-                                           hdr->checksum);
+       nf_proto_csum_replace2(&hdr->checksum, *pskb,
+                              hdr->un.echo.id, tuple->src.u.icmp.id, 0);
        hdr->un.echo.id = tuple->src.u.icmp.id;
        return 1;
 }