aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 50d0b301380e..ea0a491dce92 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -513,7 +513,8 @@ static void ipmr_cache_resolve(struct mfc_cache *uc, struct mfc_cache *c)
513 struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr)); 513 struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr));
514 514
515 if (ipmr_fill_mroute(skb, c, NLMSG_DATA(nlh)) > 0) { 515 if (ipmr_fill_mroute(skb, c, NLMSG_DATA(nlh)) > 0) {
516 nlh->nlmsg_len = skb->tail - (u8*)nlh; 516 nlh->nlmsg_len = (skb_tail_pointer(skb) -
517 (u8 *)nlh);
517 } else { 518 } else {
518 nlh->nlmsg_type = NLMSG_ERROR; 519 nlh->nlmsg_type = NLMSG_ERROR;
519 nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr)); 520 nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr));
@@ -580,7 +581,7 @@ static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert)
580 * Copy the IP header 581 * Copy the IP header
581 */ 582 */
582 583
583 skb_set_network_header(skb, skb->tail - skb->data); 584 skb->network_header = skb->tail;
584 skb_put(skb, ihl); 585 skb_put(skb, ihl);
585 memcpy(skb->data,pkt->data,ihl); 586 memcpy(skb->data,pkt->data,ihl);
586 ip_hdr(skb)->protocol = 0; /* Flag to the kernel this is a route add */ 587 ip_hdr(skb)->protocol = 0; /* Flag to the kernel this is a route add */
@@ -1544,7 +1545,7 @@ ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm)
1544 int ct; 1545 int ct;
1545 struct rtnexthop *nhp; 1546 struct rtnexthop *nhp;
1546 struct net_device *dev = vif_table[c->mfc_parent].dev; 1547 struct net_device *dev = vif_table[c->mfc_parent].dev;
1547 u8 *b = skb->tail; 1548 u8 *b = skb_tail_pointer(skb);
1548 struct rtattr *mp_head; 1549 struct rtattr *mp_head;
1549 1550
1550 if (dev) 1551 if (dev)
@@ -1564,7 +1565,7 @@ ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm)
1564 } 1565 }
1565 } 1566 }
1566 mp_head->rta_type = RTA_MULTIPATH; 1567 mp_head->rta_type = RTA_MULTIPATH;
1567 mp_head->rta_len = skb->tail - (u8*)mp_head; 1568 mp_head->rta_len = skb_tail_pointer(skb) - (u8 *)mp_head;
1568 rtm->rtm_type = RTN_MULTICAST; 1569 rtm->rtm_type = RTN_MULTICAST;
1569 return 1; 1570 return 1;
1570 1571