From patchwork Mon Aug 19 15:09:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Emelyanov X-Patchwork-Id: 268249 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3C9502C010A for ; Tue, 20 Aug 2013 01:10:03 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751059Ab3HSPJ7 (ORCPT ); Mon, 19 Aug 2013 11:09:59 -0400 Received: from relay.parallels.com ([195.214.232.42]:53411 "EHLO relay.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052Ab3HSPJ5 (ORCPT ); Mon, 19 Aug 2013 11:09:57 -0400 Received: from [10.30.3.11] (helo=mail.sw.ru) by relay.parallels.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1VBR5g-0005nv-Ue; Mon, 19 Aug 2013 19:09:56 +0400 Received: from [10.30.16.114] (10.30.16.114) by mail.sw.ru (10.30.3.11) with Microsoft SMTP Server (TLS) id 14.2.342.3; Mon, 19 Aug 2013 19:09:56 +0400 Message-ID: <52123544.30700@parallels.com> Date: Mon, 19 Aug 2013 19:09:56 +0400 From: Pavel Emelyanov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Linux Netdev List , David Miller Subject: [PATCH 2/4] tun: Report whether the queue is attached or not References: <52123515.3060507@parallels.com> In-Reply-To: <52123515.3060507@parallels.com> X-Originating-IP: [10.30.16.114] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Multiqueue tun devices allow to attach and detach from its queues while keeping the interface itself set on file. Knowing this is critical for the checkpoint part of criu project. Signed-off-by: Pavel Emelyanov --- drivers/net/tun.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index a12450b..167222f 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1881,6 +1881,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd, case TUNGETIFF: tun_get_iff(current->nsproxy->net_ns, tun, &ifr); + if (tfile->detached) + ifr.ifr_flags |= IFF_DETACH_QUEUE; + if (copy_to_user(argp, &ifr, ifreq_len)) ret = -EFAULT; break;