summaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-06-20 21:13:55 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2013-06-20 21:13:55 -0700
commite6bca5a6a8a0cdc41a9e1e3e69bc8476ac6a8ed4 (patch)
tree2651a8a7b81ee71113bdeda8425a2083f2842b20 /drivers/net/tun.c
parente8747f10ba3f7638b1c1fcab9c66a01733213d45 (diff)
parent7d132055814ef17a6c7b69f342244c410a5e000f (diff)
downloadlinux-stable-e6bca5a6a8a0cdc41a9e1e3e69bc8476ac6a8ed4.tar.gz
linux-stable-e6bca5a6a8a0cdc41a9e1e3e69bc8476ac6a8ed4.tar.bz2
linux-stable-e6bca5a6a8a0cdc41a9e1e3e69bc8476ac6a8ed4.zip
Merge tag 'v3.10-rc6' into x86/cleanups
Linux 3.10-rc6 We need a change that is the mainline tree for further work. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index f042b0373e5d..bfa9bb48e42d 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -352,7 +352,7 @@ static u16 tun_select_queue(struct net_device *dev, struct sk_buff *skb)
u32 numqueues = 0;
rcu_read_lock();
- numqueues = tun->numqueues;
+ numqueues = ACCESS_ONCE(tun->numqueues);
txq = skb_get_rxhash(skb);
if (txq) {
@@ -1585,6 +1585,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
else
return -EINVAL;
+ if (!!(ifr->ifr_flags & IFF_MULTI_QUEUE) !=
+ !!(tun->flags & TUN_TAP_MQ))
+ return -EINVAL;
+
if (tun_not_capable(tun))
return -EPERM;
err = security_tun_dev_open(tun->security);
@@ -2155,6 +2159,8 @@ static int tun_chr_open(struct inode *inode, struct file * file)
set_bit(SOCK_EXTERNALLY_ALLOCATED, &tfile->socket.flags);
INIT_LIST_HEAD(&tfile->next);
+ sock_set_flag(&tfile->sk, SOCK_ZEROCOPY);
+
return 0;
}