aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-23 03:44:42 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-23 03:44:42 -0400
commit249c8b42c7e5e6f33d0ff983041f08278b137e53 (patch)
treed7ea5f0e659833a719978d0f76f4db109e013f6d /include
parentd258b4914bcda9177bcc7bbd8e1a97b281b460af (diff)
net: Add skb_queue_next().
A lot of code wants to iterate over an SKB queue at the top level using it's own control structure and iterator scheme. Provide skb_queue_next(), which is only valid to invoke if skb_queue_is_last() returns false. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-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 3a5838da160e..d2f1778877d7 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -486,6 +486,24 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
486} 486}
487 487
488/** 488/**
489 * skb_queue_next - return the next packet in the queue
490 * @list: queue head
491 * @skb: current buffer
492 *
493 * Return the next packet in @list after @skb. It is only valid to
494 * call this if skb_queue_is_last() evaluates to false.
495 */
496static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
497 const struct sk_buff *skb)
498{
499 /* This BUG_ON may seem severe, but if we just return then we
500 * are going to dereference garbage.
501 */
502 BUG_ON(skb_queue_is_last(list, skb));
503 return skb->next;
504}
505
506/**
489 * skb_get - reference buffer 507 * skb_get - reference buffer
490 * @skb: buffer to reference 508 * @skb: buffer to reference
491 * 509 *