Thread (13 messages) flat view 13 messages, 4 authors, 2016-08-22

Re: [PATCH 1/3] vsockmon: Add tap functions.

From: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2016-08-10 18:46:46

On Mon, Aug 08, 2016 at 06:14:40PM +0200, ggarcia@abra.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.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help