Thread (5 messages) 5 messages, 2 authors, 2017-02-10
STALE3516d REVIEWED: 1 (0M)

1 review trailer.

[PATCH net-next V3 1/3] net/skbuff: Introduce skb_mac_offset()

From: Amir Vadai <hidden>
Date: 2017-02-07 07:56:26
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Introduce skb_mac_offset() that could be used to get mac header offset.

Signed-off-by: Amir Vadai <redacted>
Reviewed-by: Or Gerlitz <redacted>
---
 include/linux/skbuff.h | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c6a78e1892b6..a1b73b794a38 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2182,6 +2182,11 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
 	return skb->head + skb->mac_header;
 }
 
+static inline int skb_mac_offset(const struct sk_buff *skb)
+{
+	return skb_mac_header(skb) - skb->data;
+}
+
 static inline int skb_mac_header_was_set(const struct sk_buff *skb)
 {
 	return skb->mac_header != (typeof(skb->mac_header))~0U;
-- 
2.11.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help