[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160810114033.GA10461@stefanha-x1.localdomain>
Date: Wed, 10 Aug 2016 12:40:33 +0100
From: Stefan Hajnoczi <stefanha@...hat.com>
To: ggarcia@...a.uab.cat
Cc: netdev@...r.kernel.org, jhansen@...are.com, mst@...hat.com
Subject: Re: [PATCH 1/3] vsockmon: Add tap functions.
On Mon, Aug 08, 2016 at 06:14:40PM +0200, ggarcia@...a.uab.cat wrote:
> +static int __vsock_deliver_tap_skb(struct sk_buff *skb,
> + struct net_device *dev)
> +{
> + int ret = 0;
> +
> + if (skb) {
> + dev_hold(dev);
> + /* Take skb ownership so it is not consumed in dev_queue_xmit.
> + * dev_queue_xmit will drop a reference so the reference count
> + * will reset.
> + */
> + skb_get(skb);
Netlink clones the skb instead of adding a reference. I guess this is
because the skb might be modified later on? Perhaps there are race
conditions if the original skb is shared.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists