Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc7ebb21 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parent b5f61ab9
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -472,6 +472,19 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
	return list->next == (struct sk_buff *)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_get - reference buffer
 *	@skb: buffer to reference
 *	@skb: buffer to reference