[Top] [All Lists]

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

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code
From: Tommy Christensen <tommy.christensen@xxxxxxxxx>
Date: Sun, 12 Oct 2003 12:00:09 +0200
Cc: Ben Greear <greearb@xxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
References: <3F87430D.2040000@xxxxxxxxx> <3F87464B.1020908@xxxxxxxxxxxxxxx> <3F874A30.6010700@xxxxxxxxx> <3F885418.3090407@xxxxxxxxxxxxxxx> <20031011120339.0da631e6.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003
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.


<Prev in Thread] Current Thread [Next in Thread>