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

From: Tommy Christensen <[email-masked]>
Date: Sun, 12 Oct 2003 12:00:09 +0200

David S. Miller wrote:

> The current code is correct and handles shared SKBs properly,
> so I don't think it's worth playing around with this much more.

No, it is still not right.

Bear with me, but this is how I understand it:

  - The sk_buff *structure* is read-only on a shared SKB.
    skb_share_check(skb) breaks the sharing, thus allowing
    updates of skb->dev, skb->len etc.
    But the SKB still points at the same data buffer.

  - The *data* buffer is read-only on a cloned SKB.
    skb_cow() or skb_copy() or ... gives us a writeable buffer.

The tcpdump problem was caused by violating the second rule,
this is now fixed.

But the code still doesn't follow the first rule, which is
what this patch fixes.

-Tommy