net: remove last caller of skb_tail_offset() and itself
authorCong Wang <amwang@redhat.com>
Wed, 5 Jun 2013 12:14:10 +0000 (20:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Jun 2013 05:22:23 +0000 (22:22 -0700)
Similar to the following commits:

commit 00f97da17a0c8d656d0c9 (netpoll: fix position of network header)
commit 525cebedb32a87fa48584 (pktgen: Fix position of ip and udp header)

using skb_tail_offset() seems not correct since the offset
is based on head pointer.

With the last caller removed, skb_tail_offset() can be killed
finally.

Cc: Thomas Graf <tgraf@suug.ch>
Cc: Daniel Borkmann <dborkmann@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/ipv4/ipmr.c

index 400d82ae2b0312fadbc4e84b8e16a7fda946d9b8..a7393adea0b5cce9cdbaf0eca1c21e14589c0009 100644 (file)
@@ -1396,10 +1396,6 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
        skb->tail += offset;
 }
 
-static inline unsigned long skb_tail_offset(const struct sk_buff *skb)
-{
-       return skb->tail;
-}
 #else /* NET_SKBUFF_DATA_USES_OFFSET */
 static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb)
 {
@@ -1416,10 +1412,6 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
        skb->tail = skb->data + offset;
 }
 
-static inline unsigned long skb_tail_offset(const struct sk_buff *skb)
-{
-       return skb->tail - skb->head;
-}
 #endif /* NET_SKBUFF_DATA_USES_OFFSET */
 
 /*
index df97f0ac1a1cec50085977ce21196d990e221ce2..132a09664704ed73ed850e8961f11fa3e3641473 100644 (file)
@@ -945,7 +945,6 @@ static int ipmr_cache_report(struct mr_table *mrt,
        struct igmpmsg *msg;
        struct sock *mroute_sk;
        int ret;
-       unsigned long tail_offset;
 
 #ifdef CONFIG_IP_PIMSM
        if (assert == IGMPMSG_WHOLEPKT)
@@ -981,12 +980,7 @@ static int ipmr_cache_report(struct mr_table *mrt,
 
        /* Copy the IP header */
 
-       tail_offset = skb_tail_offset(skb);
-       if (tail_offset > 0xffff) {
-               kfree_skb(skb);
-               return -EINVAL;
-       }
-       skb_set_network_header(skb, tail_offset);
+       skb_set_network_header(skb, skb->len);
        skb_put(skb, ihl);
        skb_copy_to_linear_data(skb, pkt->data, ihl);
        ip_hdr(skb)->protocol = 0;      /* Flag to the kernel this is a route add */