diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-21 01:47:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-21 01:47:32 -0500 |
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 bf221d65d9ad..6e946da9d1d6 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) | |||
1801 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ | 1801 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ |
1802 | skb = skb->prev) | 1802 | skb = skb->prev) |
1803 | 1803 | ||
1804 | #define skb_queue_reverse_walk_safe(queue, skb, tmp) \ | ||
1805 | for (skb = (queue)->prev, tmp = skb->prev; \ | ||
1806 | skb != (struct sk_buff *)(queue); \ | ||
1807 | skb = tmp, tmp = skb->prev) | ||
1808 | |||
1809 | #define skb_queue_reverse_walk_from_safe(queue, skb, tmp) \ | ||
1810 | for (tmp = skb->prev; \ | ||
1811 | skb != (struct sk_buff *)(queue); \ | ||
1812 | skb = tmp, tmp = skb->prev) | ||
1804 | 1813 | ||
1805 | static inline bool skb_has_frag_list(const struct sk_buff *skb) | 1814 | static inline bool skb_has_frag_list(const struct sk_buff *skb) |
1806 | { | 1815 | { |