aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-04-30 03:50:54 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-30 03:55:20 -0400
commit58717686cf7c7f5a70b3a8907ade8a3ce74306b1 (patch)
tree57f5d78524bfd5e65aa9f3943da9c1a3e6ff65b7 /drivers/net/tun.c
parentcff63a52924c6a78fa525c67d81480c85736ff3c (diff)
parent79f632c71bea0d0864d84d6a4ce78da5a9430f5b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/emulex/benet/be.h include/net/tcp.h net/mac802154/mac802154.h Most conflicts were minor overlapping stuff. The be2net driver brought in some fixes that added __vlan_put_tag calls, which in net-next take an additional argument. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 66109a2ad886..f042b0373e5d 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1471,14 +1471,17 @@ static int tun_recvmsg(struct kiocb *iocb, struct socket *sock,
1471 if (!tun) 1471 if (!tun)
1472 return -EBADFD; 1472 return -EBADFD;
1473 1473
1474 if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) 1474 if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) {
1475 return -EINVAL; 1475 ret = -EINVAL;
1476 goto out;
1477 }
1476 ret = tun_do_read(tun, tfile, iocb, m->msg_iov, total_len, 1478 ret = tun_do_read(tun, tfile, iocb, m->msg_iov, total_len,
1477 flags & MSG_DONTWAIT); 1479 flags & MSG_DONTWAIT);
1478 if (ret > total_len) { 1480 if (ret > total_len) {
1479 m->msg_flags |= MSG_TRUNC; 1481 m->msg_flags |= MSG_TRUNC;
1480 ret = flags & MSG_TRUNC ? ret : total_len; 1482 ret = flags & MSG_TRUNC ? ret : total_len;
1481 } 1483 }
1484out:
1482 tun_put(tun); 1485 tun_put(tun);
1483 return ret; 1486 return ret;
1484} 1487}
@@ -1593,8 +1596,12 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1593 return err; 1596 return err;
1594 1597
1595 if (tun->flags & TUN_TAP_MQ && 1598 if (tun->flags & TUN_TAP_MQ &&
1596 (tun->numqueues + tun->numdisabled > 1)) 1599 (tun->numqueues + tun->numdisabled > 1)) {
1597 return -EBUSY; 1600 /* One or more queue has already been attached, no need
1601 * to initialize the device again.
1602 */
1603 return 0;
1604 }
1598 } 1605 }
1599 else { 1606 else {
1600 char *name; 1607 char *name;