diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-20 22:47:32 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-20 22:47:32 -0800 |
commit | 686a2955531312dab77bb6f1e8602787d85e47d8 (patch) | |
tree | 4209f28a17bbd4ba124484d2e57a1f52f22734cd /include/linux/skbuff.h | |
parent | 212bfb9e94e86b40684076f642b089b0565455d2 (diff) |
net: Add safe reverse SKB queue walkers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bf221d65d9a..6e946da9d1d 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1801,6 +1801,15 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ skb = skb->prev) +#define skb_queue_reverse_walk_safe(queue, skb, tmp) \ + for (skb = (queue)->prev, tmp = skb->prev; \ + skb != (struct sk_buff *)(queue); \ + skb = tmp, tmp = skb->prev) + +#define skb_queue_reverse_walk_from_safe(queue, skb, tmp) \ + for (tmp = skb->prev; \ + skb != (struct sk_buff *)(queue); \ + skb = tmp, tmp = skb->prev) static inline bool skb_has_frag_list(const struct sk_buff *skb) { |