David S. Miller wrote: >On Sun, 02 Jan 2005 22:19:45 +0100 >Patrick McHardy wrote: > > > >>skb_ip_make_writable copies the packet as soon as the data area needs >>to be touched. This is of course necessary for packets generated locally, >>but can't we mangle the data area of skbs with skb->sk == NULL without >>copying them ? >> >> > >Not if they are cloned. tcpdump can still share access to the >packet. > > > I wasn't very clear in my question, it only makes sense if you look at skb_ip_make_writable :) It already checks for skb_shared || skb_cloned to decide when to copy, but additionally makes some guesses based on the protocol. I think the checks for skb_shared || skb_clones should already catch all cases where copying is necessary, and the additional cases could be removed. Regards Patrick