Skip to content

Commit

Permalink
net: Add skb_queue_is_last().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Sep 23, 2008
1 parent b5f61ab commit fc7ebb2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,19 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
return list->next == (struct sk_buff *)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
Expand Down

0 comments on commit fc7ebb2

Please sign in to comment.