From: Zhu Yi <yi...@in...> - 2005-08-05 08:34:38
|
On Thu, 2005-08-04 at 14:04 -0500, James Ketrenos wrote: > James Ketrenos wrote: > > >Yi -- if you have time during your day today, can you take a look at > >this? We should be able to modify ieee80211_tx's ieee80211_xmit() > >method so that it doesn't have to overwrite the incoming SKB and can > >just stick the snap on the first TXB constructed. If I have some more > >free time today I'll take a crack at it and send out a patch if I get it > >done. If you don't see a patch from me for the above, assume I didn't > >get to look into it further. > > > > > Alright; I had few minutes. Try the attached (it runs here, don't know > if it will solve the problem though) You are right. The skb is shared between ieee80211_xmit and PF_PACKET socket (if any). So if we change it in the stack, the raw socket will also see the change. I think it is another good reason for the native ieee80211 stack. If we process protocol headers in network stacks instead of dev->hard_start_xmit, we won't have this kind of problem. Currently I think making a copy to the skb can solve it well. You patch is correct. Another apporach is using skb_unshare() at the beginning of ieee80211_xmit(). It will copy another skb only if the skb is cloned. So the overload is also small. I've attached the patch FYI. Thanks, -yi |