netdev
[Top] [All Lists]

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

To: Tommy Christensen <tommy.christensen@xxxxxxxxx>
Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Mon, 13 Oct 2003 10:19:35 -0700
Cc: greearb@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <3F892629.7090206@xxxxxxxxx>
References: <3F87430D.2040000@xxxxxxxxx> <3F87464B.1020908@xxxxxxxxxxxxxxx> <3F874A30.6010700@xxxxxxxxx> <3F885418.3090407@xxxxxxxxxxxxxxx> <20031011120339.0da631e6.davem@xxxxxxxxxx> <3F892629.7090206@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Sun, 12 Oct 2003 12:00:09 +0200
Tommy Christensen <tommy.christensen@xxxxxxxxx> wrote:

> 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.

skb_copy() makes both the struct sk_buff and the data it points
to unique and yours alone to modify however you wish.

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