aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-23 03:34:07 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-23 03:34:07 -0400
commitfc7ebb212d3e51d1188948d975aa93dbb0f58b25 (patch)
treeb4b0c1922e1128626b02482636c767392866b581 /include/linux/skbuff.h
parentb5f61ab96dd093c5190c1540fed14f71ed821ce7 (diff)
net: Add skb_queue_is_last().
Several bits of code want to know "is this the last SKB in a queue", and all of them implement this by hand. Provide an common interface to make this check. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4a144e8d0538..3a5838da160e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -473,6 +473,19 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
473} 473}
474 474
475/** 475/**
476 * skb_queue_is_last - check if skb is the last entry in the queue
477 * @list: queue head
478 * @skb: buffer
479 *
480 * Returns true if @skb is the last buffer on the list.
481 */
482static inline bool skb_queue_is_last(const struct sk_buff_head *list,
483 const struct sk_buff *skb)
484{
485 return (skb->next == (struct sk_buff *) list);
486}
487
488/**
476 * skb_get - reference buffer 489 * skb_get - reference buffer
477 * @skb: buffer to reference 490 * @skb: buffer to reference
478 * 491 *