This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / net / ipv4 / netfilter / ip_nat_proto_udp.c
index 12c19bf..240004e 100644 (file)
@@ -83,13 +83,11 @@ udp_unique_tuple(struct ip_conntrack_tuple *tuple,
 
 static int
 udp_manip_pkt(struct sk_buff **pskb,
-             unsigned int iphdroff,
+             unsigned int hdroff,
              const struct ip_conntrack_manip *manip,
              enum ip_nat_manip_type maniptype)
 {
-       struct iphdr *iph = (struct iphdr *)((*pskb)->data + iphdroff);
        struct udphdr *hdr;
-       unsigned int hdroff = iphdroff + iph->ihl*4;
        u_int32_t oldip;
        u_int16_t *portptr;
 
@@ -99,11 +97,11 @@ udp_manip_pkt(struct sk_buff **pskb,
        hdr = (void *)(*pskb)->data + hdroff;
        if (maniptype == IP_NAT_MANIP_SRC) {
                /* Get rid of src ip and src pt */
-               oldip = iph->saddr;
+               oldip = (*pskb)->nh.iph->saddr;
                portptr = &hdr->source;
        } else {
                /* Get rid of dst ip and dst pt */
-               oldip = iph->daddr;
+               oldip = (*pskb)->nh.iph->daddr;
                portptr = &hdr->dest;
        }
        if (hdr->check) /* 0 is a special case meaning no checksum */