RE:[Ebtables-devel] skb_share_check ??
"sapyo" <sapyo-oEM2CjCtWMxWk0Htik3J/[email protected]>
| Newsgroups | gmane.linux.network.bridge.ebtables.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Bart,
To my knowledge, "share" means a single packet reference is delivered to mulitple packet handlers. A packet is declared to be shared by increasing skb->users.
"sharing" happens in netif_receive_skb() net/core/dev.c. A packet may be processed by more than one handler in ptype_all, bridge, and ptype_base.
We can see that every packet handler has to prevent from processing a shared packet.
- ptype_all: packet_rcv_spkt
- ptype_base: ip_rcv, arp_rcv, rarp_recv, ic_rarp_recv, ic_bootp_recv, ...
Then in 2.4, why we cannot see any skb_share_check() in brige?
It is because: if a bridge is enabled, handle_bridge is the last one handler. There is no need for bridge to skb_share_check.
It still holds in 2.6, so no skb_share_check is used in 2.6 bridge when ebtables is disabled. So, why does ebtables have to share_check ??? Did I miss anything?
Compared to IP, skb_share_check is a must since other handlers may also be registered to handle IP packet. But please note, skb_share_check is called in begining of ip_rcv(). It means iptables doesn't call share_check().
I just wondering why ebtables calls share_check.
If it is just to copy/paste, we should remove this redundant code.
Regards,
Siming Li
>On Monday 22 March 2004 10:26, sapyo wrote:
>> Why skb_share_check is needed in 2.6 bridge ebtables?
>
>That's part of the copy/paste from the IP code which checks a few things. I'm
>not sure if it's really needed for the bridged case, but as the overhead of
>the check is quite small I don't see any problem in keeping the check just to
>make sure.
>
>cheers,
>Bart
>
>.
>
========================================
唳答頝雿暻餃! 撖嗥拇鞈駁銝蝺!
http://match.sina.com.tw
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click