diff options
author | Jason Wang <jasowang@redhat.com> | 2013-04-22 20:40:39 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-27 10:39:07 -0700 |
commit | 0eba2a6a88197e5581087c919be84312a144c936 (patch) | |
tree | a19457f66e100614461f89326533b389e2c625d3 /drivers | |
parent | 1017d77dc87e2444bb58416725621d5413d03047 (diff) |
tuntap: correct the return value in tun_set_iff()
[ Upstream commit e8dbad66ef56074eadb41ed5998acd2320447018 ]
commit (3be8fbab tuntap: fix error return code in tun_set_iff()) breaks the
creation of multiqueue tuntap since it forbids to create more than one queues
for a multiqueue tuntap device. We need return 0 instead -EBUSY here since we
don't want to re-initialize the device when one or more queues has been already
attached. Add a comment and correct the return value to zero.
Reported-by: Jerry Chu <hkchu@google.com>
Cc: Jerry Chu <hkchu@google.com>
Cc: Wei Yongjun <weiyj.lk@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Jerry Chu <hkchu@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/tun.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 722f11debcdf..7d3e73340dd5 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1600,8 +1600,12 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) return err; if (tun->flags & TUN_TAP_MQ && - (tun->numqueues + tun->numdisabled > 1)) - return -EBUSY; + (tun->numqueues + tun->numdisabled > 1)) { + /* One or more queue has already been attached, no need + * to initialize the device again. + */ + return 0; + } } else { char *name; |