summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2012-02-21 07:31:18 +0000
committerDavid S. Miller <davem@davemloft.net>2012-02-21 14:58:57 -0500
commitda5ef6e51b327b41180b5d1000c06e8d3595a936 (patch)
tree88261e4a5edaa8ee113dc7918ce8b2ca2903842f
parent3f518bf745cbd6007d8069100fb9cb09e960c872 (diff)
skb: Add skb_peek_next helper
Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/skbuff.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f3cf43de3c2a..c11a44ea1bf4 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -877,6 +877,24 @@ static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_)
}
/**
+ * skb_peek_next - peek skb following the given one from a queue
+ * @skb: skb to start from
+ * @list_: list to peek at
+ *
+ * Returns %NULL when the end of the list is met or a pointer to the
+ * next element. The reference count is not incremented and the
+ * reference is therefore volatile. Use with caution.
+ */
+static inline struct sk_buff *skb_peek_next(struct sk_buff *skb,
+ const struct sk_buff_head *list_)
+{
+ struct sk_buff *next = skb->next;
+ if (next == (struct sk_buff *)list_)
+ next = NULL;
+ return next;
+}
+
+/**
* skb_peek_tail - peek at the tail of an &sk_buff_head
* @list_: list to peek at
*