Re: list_for_each_entry_rcu in net/core/dev.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michele 'mydecay' Marchetto wrote:
hi all.
i have noticed that in list_for_each_entry_rcu the checks
(!ptype->dev || ptype->dev == skb->dev) are made on the current
packet but the function (delived_skb) is called on the previous one.

i can't understand why this make sense.. anyone can explain me?

I've seen that idiom used elsewhere in the kernel... look down further after the loop, I'll bet the last one found is used later. ... yup. See http://lxr.linux.no/source/net/core/dev.c?v=2.6.0-test7#L1534 pt_prev is referenced after the loop.

Took me a while to see it the first time, too.
- Dan

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux