diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-23 00:34:07 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-23 00:34:07 -0700 |
commit | fc7ebb212d3e51d1188948d975aa93dbb0f58b25 (patch) | |
tree | b4b0c1922e1128626b02482636c767392866b581 /include | |
parent | b5f61ab96dd093c5190c1540fed14f71ed821ce7 (diff) | |
download | linux-fc7ebb212d3e51d1188948d975aa93dbb0f58b25.tar.bz2 |
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')
-rw-r--r-- | include/linux/skbuff.h | 13 |
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) } /** + * skb_queue_is_last - check if skb is the last entry in the queue + * @list: queue head + * @skb: buffer + * + * Returns true if @skb is the last buffer on the list. + */ +static inline bool skb_queue_is_last(const struct sk_buff_head *list, + const struct sk_buff *skb) +{ + return (skb->next == (struct sk_buff *) list); +} + +/** * skb_get - reference buffer * @skb: buffer to reference * |