[POWERPC] Fix warning in hpte_decode(), and generalize it
[powerpc.git] / net / ipv4 / ipmr.c
index 3578942..0ebae41 100644 (file)
@@ -62,6 +62,7 @@
 #include <linux/netfilter_ipv4.h>
 #include <net/ipip.h>
 #include <net/checksum.h>
+#include <net/netlink.h>
 
 #if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2)
 #define CONFIG_IP_PIMSM        1
@@ -513,7 +514,8 @@ static void ipmr_cache_resolve(struct mfc_cache *uc, struct mfc_cache *c)
                        struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr));
 
                        if (ipmr_fill_mroute(skb, c, NLMSG_DATA(nlh)) > 0) {
-                               nlh->nlmsg_len = skb->tail - (u8*)nlh;
+                               nlh->nlmsg_len = (skb_tail_pointer(skb) -
+                                                 (u8 *)nlh);
                        } else {
                                nlh->nlmsg_type = NLMSG_ERROR;
                                nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr));
@@ -580,9 +582,9 @@ static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert)
         *      Copy the IP header
         */
 
-       skb_set_network_header(skb, skb->tail - skb->data);
+       skb->network_header = skb->tail;
        skb_put(skb, ihl);
-       memcpy(skb->data,pkt->data,ihl);
+       skb_copy_to_linear_data(skb, pkt->data, ihl);
        ip_hdr(skb)->protocol = 0;                      /* Flag to the kernel this is a route add */
        msg = (struct igmpmsg *)skb_network_header(skb);
        msg->im_vif = vifi;
@@ -597,7 +599,7 @@ static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert)
        msg->im_msgtype = assert;
        igmp->code      =       0;
        ip_hdr(skb)->tot_len = htons(skb->len);                 /* Fix the length */
-       skb->h.raw = skb->nh.raw;
+       skb->transport_header = skb->network_header;
        }
 
        if (mroute_socket == NULL) {
@@ -1102,7 +1104,7 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
        struct iphdr *old_iph = ip_hdr(skb);
 
        skb_push(skb, sizeof(struct iphdr));
-       skb->h.raw = skb->nh.raw;
+       skb->transport_header = skb->network_header;
        skb_reset_network_header(skb);
        iph = ip_hdr(skb);
 
@@ -1461,7 +1463,7 @@ int pim_rcv_v1(struct sk_buff * skb)
        if (reg_dev == NULL)
                goto drop;
 
-       skb->mac.raw = skb->nh.raw;
+       skb->mac_header = skb->network_header;
        skb_pull(skb, (u8*)encap - skb->data);
        skb_reset_network_header(skb);
        skb->dev = reg_dev;
@@ -1517,7 +1519,7 @@ static int pim_rcv(struct sk_buff * skb)
        if (reg_dev == NULL)
                goto drop;
 
-       skb->mac.raw = skb->nh.raw;
+       skb->mac_header = skb->network_header;
        skb_pull(skb, (u8*)encap - skb->data);
        skb_reset_network_header(skb);
        skb->dev = reg_dev;
@@ -1544,7 +1546,7 @@ ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm)
        int ct;
        struct rtnexthop *nhp;
        struct net_device *dev = vif_table[c->mfc_parent].dev;
-       u8 *b = skb->tail;
+       u8 *b = skb_tail_pointer(skb);
        struct rtattr *mp_head;
 
        if (dev)
@@ -1564,12 +1566,12 @@ ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm)
                }
        }
        mp_head->rta_type = RTA_MULTIPATH;
-       mp_head->rta_len = skb->tail - (u8*)mp_head;
+       mp_head->rta_len = skb_tail_pointer(skb) - (u8 *)mp_head;
        rtm->rtm_type = RTN_MULTICAST;
        return 1;
 
 rtattr_failure:
-       skb_trim(skb, b - skb->data);
+       nlmsg_trim(skb, b);
        return -EMSGSIZE;
 }