Project

General

Profile

Feature #3465

Updated by Mikhail Mandrykin almost 8 years ago

There are some special marco definitions intended for some specific list or queue traverses. For instance,
<pre>
#define skb_queue_walk_safe(queue, skb, tmp) \
for (skb = (queue)->next, tmp = skb->next; \
skb != (struct sk_buff *)(queue); \
skb = tmp, tmp = skb->next)
</pre>
It's desirable sometimes to have some instructions executed at each iteration of such loops. Here, for example, this macro enables us to detect assignments to @skb@ varaible which is useful in checking for double @skb@ deallocations.
<pre>
skb_queue_walk_safe(tx_skb_queue, skb, tmp) {
if (...) {
...
kfree_skb(skb);
}
}
</pre>

Back