net: Add skb_inner_transport_offset function
authorTom Herbert <tom@herbertland.com>
Mon, 14 Dec 2015 19:19:40 +0000 (11:19 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Dec 2015 21:49:57 +0000 (16:49 -0500)
Same thing as skb_transport_offset but returns the offset of the inner
transport header (when skb->encpasulation is set).

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h

index af4f6ac025b6b360be51363d4e0fc3652b76040f..2393373c9d08c91bdebd8931a76de96bc3f32df0 100644 (file)
@@ -1939,6 +1939,11 @@ static inline unsigned char *skb_inner_transport_header(const struct sk_buff
        return skb->head + skb->inner_transport_header;
 }
 
+static inline int skb_inner_transport_offset(const struct sk_buff *skb)
+{
+       return skb_inner_transport_header(skb) - skb->data;
+}
+
 static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
 {
        skb->inner_transport_header = skb->data - skb->head;