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

From: Tommy Christensen <[email-masked]>
Date: Sat, 11 Oct 2003 02:09:20 +0200

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.

Admittedly, the naming is not very helpful. skb_share_check() handles shared
sk_buff's, while skb_unshare() handles cloned sk_buff's. Well ...

-Tommy