Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d407a80 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller
Browse files

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: default avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fb7589a1
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -1881,6 +1881,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
	case TUNGETIFF:
	case TUNGETIFF:
		tun_get_iff(current->nsproxy->net_ns, tun, &ifr);
		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))
		if (copy_to_user(argp, &ifr, ifreq_len))
			ret = -EFAULT;
			ret = -EFAULT;
		break;
		break;