From: Pavel Emelyanov Date: Wed, 21 Aug 2013 10:32:00 +0000 (+0400) Subject: tun: Report whether the queue is attached or not X-Git-Tag: accepted/tizen/common/20141203.182822~1569^2~219^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d407a80b62fc5891b41fe9045f23aba4437fc33;p=platform%2Fkernel%2Flinux-arm64.git tun: Report whether the queue is attached or not 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 4b65fbc..db43a24 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;