]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/skbuff.h
net: Add skb_queue_next().
[linux-2.6-omap-h63xx.git] / include / linux / skbuff.h
index 3a5838da160ebe81fdc7f49a7f8617462426030b..d2f1778877d74066bce0b06cb163a5f97997177a 100644 (file)
@@ -485,6 +485,24 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
        return (skb->next == (struct sk_buff *) list);
 }
 
+/**
+ *     skb_queue_next - return the next packet in the queue
+ *     @list: queue head
+ *     @skb: current buffer
+ *
+ *     Return the next packet in @list after @skb.  It is only valid to
+ *     call this if skb_queue_is_last() evaluates to false.
+ */
+static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
+                                            const struct sk_buff *skb)
+{
+       /* This BUG_ON may seem severe, but if we just return then we
+        * are going to dereference garbage.
+        */
+       BUG_ON(skb_queue_is_last(list, skb));
+       return skb->next;
+}
+
 /**
  *     skb_get - reference buffer
  *     @skb: buffer to reference