Merge branch 'for-2.6.22' of git://git.kernel.dk/data/git/linux-2.6-block
[powerpc.git] / net / ipv4 / ipmr.c
index 50d0b30..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;
@@ -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;
 }