Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code

From: Ben Greear <[email-masked]>
Date: Sat, 11 Oct 2003 12:03:52 -0700

Tommy Christensen wrote:
> Ben Greear wrote:
> 
>>> -        if (skb_shared(skb) || skb_cloned(skb)) {
>>> -            struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
>>> -            kfree(skb);
>>> -            skb = nskb;
>>> -        }
>>> +        skb = skb_unshare(skb, GFP_ATOMIC);
>>
>>
>>
>> On 2.4.22, at least, skb_unshare only checks skb_cloned(), so do we
>> also need to check skb_shared()?  Or was that check in the old patch 
>> above
>> not needed?
> 
> 
> skb_shared() is now taken care of by skb_share_check(), called earlier 
> in the
> receive routine.

Maybe we should have a method called:  skb_get_me_an_skb_that_I_can_modify(skb);

Then the subtle differences between sharing, cloning, etc can be handled
by the skb code internally...

Ben

-- 
Ben Greear <[email-masked]>
Candela Technologies Inc  http://www.candelatech.com