[NETFILTER]: nf_nat_h323: call set_h225_addr instead of set_h225_addr_hook
[sfrench/cifs-2.6.git] / net / ipv4 / netfilter / nf_nat_h323.c
index 9cbf3f9be13b050ef013d1e9d60313f34630ce1b..c5d2a2d690b84e54b558ac8e558b6c0550a7ac36 100644 (file)
@@ -33,7 +33,7 @@ static int set_addr(struct sk_buff **pskb,
                    unsigned int addroff, __be32 ip, __be16 port)
 {
        enum ip_conntrack_info ctinfo;
-       struct nf_conn *ct = ip_conntrack_get(*pskb, &ctinfo);
+       struct nf_conn *ct = nf_ct_get(*pskb, &ctinfo);
        struct {
                __be32 ip;
                __be16 port;
@@ -44,7 +44,7 @@ static int set_addr(struct sk_buff **pskb,
        buf.port = port;
        addroff += dataoff;
 
-       if ((*pskb)->nh.iph->protocol == IPPROTO_TCP) {
+       if (ip_hdr(*pskb)->protocol == IPPROTO_TCP) {
                if (!nf_nat_mangle_tcp_packet(pskb, ct, ctinfo,
                                              addroff, sizeof(buf),
                                              (char *) &buf, sizeof(buf))) {
@@ -55,11 +55,11 @@ static int set_addr(struct sk_buff **pskb,
                }
 
                /* Relocate data pointer */
-               th = skb_header_pointer(*pskb, (*pskb)->nh.iph->ihl * 4,
+               th = skb_header_pointer(*pskb, ip_hdrlen(*pskb),
                                        sizeof(_tcph), &_tcph);
                if (th == NULL)
                        return -1;
-               *data = (*pskb)->data + (*pskb)->nh.iph->ihl * 4 +
+               *data = (*pskb)->data + ip_hdrlen(*pskb) +
                    th->doff * 4 + dataoff;
        } else {
                if (!nf_nat_mangle_udp_packet(pskb, ct, ctinfo,
@@ -73,8 +73,8 @@ static int set_addr(struct sk_buff **pskb,
                /* nf_nat_mangle_udp_packet uses skb_make_writable() to copy
                 * or pull everything in a linear buffer, so we can safely
                 * use the skb pointers now */
-               *data = (*pskb)->data + (*pskb)->nh.iph->ihl * 4 +
-                   sizeof(struct udphdr);
+               *data = ((*pskb)->data + ip_hdrlen(*pskb) +
+                        sizeof(struct udphdr));
        }
 
        return 0;
@@ -383,7 +383,7 @@ static int nat_h245(struct sk_buff **pskb, struct nf_conn *ct,
 static void ip_nat_q931_expect(struct nf_conn *new,
                               struct nf_conntrack_expect *this)
 {
-       struct ip_nat_range range;
+       struct nf_nat_range range;
 
        if (this->tuple.src.u3.ip != 0) {       /* Only accept calls from GK */
                nf_nat_follow_master(new, this);
@@ -455,9 +455,9 @@ static int nat_q931(struct sk_buff **pskb, struct nf_conn *ct,
                if (idx > 0 &&
                    get_h225_addr(ct, *data, &taddr[0], &addr, &port) &&
                    (ntohl(addr.ip) & 0xff000000) == 0x7f000000) {
-                       set_h225_addr_hook(pskb, data, 0, &taddr[0],
-                                          &ct->tuplehash[!dir].tuple.dst.u3,
-                                          info->sig_port[!dir]);
+                       set_h225_addr(pskb, data, 0, &taddr[0],
+                                     &ct->tuplehash[!dir].tuple.dst.u3,
+                                     info->sig_port[!dir]);
                }
        } else {
                nf_conntrack_unexpect_related(exp);