]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/ipmr.c
[SK_BUFF] ipmr: Another skb_push related conversion to skb_reset_network_header
[net-next-2.6.git] / net / ipv4 / ipmr.c
index 45435f0a5d6c3404abac587fa5553e7b1c5618a4..465459d59b21045684d9ba1f7f80df43cf280c48 100644 (file)
@@ -561,9 +561,11 @@ static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert)
                   And all this only to mangle msg->im_msgtype and
                   to set msg->im_mbz to "mbz" :-)
                 */
-               msg = (struct igmpmsg*)skb_push(skb, sizeof(struct iphdr));
-               skb->nh.raw = skb->h.raw = (u8*)msg;
-               memcpy(msg, pkt->nh.raw, sizeof(struct iphdr));
+               skb_push(skb, sizeof(struct iphdr));
+               skb_reset_network_header(skb);
+               skb->h.raw = skb->data;
+               msg = (struct igmpmsg *)skb->nh.raw;
+               memcpy(msg, skb_network_header(pkt), sizeof(struct iphdr));
                msg->im_msgtype = IGMPMSG_WHOLEPKT;
                msg->im_mbz = 0;
                msg->im_vif = reg_vif_num;
@@ -1093,7 +1095,12 @@ static struct notifier_block ip_mr_notifier={
 
 static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
 {
-       struct iphdr *iph = (struct iphdr *)skb_push(skb,sizeof(struct iphdr));
+       struct iphdr *iph;
+
+       skb_push(skb, sizeof(struct iphdr));
+       skb->h.ipiph = skb->nh.iph;
+       skb_reset_network_header(skb);
+       iph = skb->nh.iph;
 
        iph->version    =       4;
        iph->tos        =       skb->nh.iph->tos;
@@ -1107,8 +1114,6 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
        ip_select_ident(iph, skb->dst, NULL);
        ip_send_check(iph);
 
-       skb->h.ipiph = skb->nh.iph;
-       skb->nh.iph = iph;
        memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
        nf_reset(skb);
 }