Commit e8dbad66 authored by Jason Wang's avatar Jason Wang Committed by David S. Miller

tuntap: correct the return value in tun_set_iff()

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: default avatarJerry 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: default avatarJason Wang <jasowang@redhat.com>
Acked-by: default avatarJerry Chu <hkchu@google.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5ffedc6e
...@@ -1593,8 +1593,12 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) ...@@ -1593,8 +1593,12 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
return err; return err;
if (tun->flags & TUN_TAP_MQ && if (tun->flags & TUN_TAP_MQ &&
(tun->numqueues + tun->numdisabled > 1)) (tun->numqueues + tun->numdisabled > 1)) {
return -EBUSY; /* One or more queue has already been attached, no need
* to initialize the device again.
*/
return 0;
}
} }
else { else {
char *name; char *name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment