aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index a1ed2d983740..329d9feb9b89 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -39,7 +39,6 @@
#define DRV_DESCRIPTION "Universal TUN/TAP device driver"
#define DRV_COPYRIGHT "(C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>"
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
@@ -490,6 +489,9 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr)
err = -EINVAL;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
/* Set dev type */
if (ifr->ifr_flags & IFF_TUN) {
/* TUN device */
@@ -777,7 +779,6 @@ static struct miscdevice tun_miscdev = {
.minor = TUN_MINOR,
.name = "tun",
.fops = &tun_fops,
- .devfs_name = "net/tun",
};
/* ethtool interface */