aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tun.c8
-rw-r--r--include/linux/if_tun.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7ab94c825b5..3bb991fd2b5 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -640,6 +640,14 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
return 0;
}
+ if (cmd == TUNGETFEATURES) {
+ /* Currently this just means: "what IFF flags are valid?".
+ * This is needed because we never checked for invalid flags on
+ * TUNSETIFF. */
+ return put_user(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE,
+ (unsigned int __user*)argp);
+ }
+
if (!tun)
return -EBADFD;
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 18f31b6187a..94f76a11230 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -40,6 +40,7 @@
#define TUNSETOWNER _IOW('T', 204, int)
#define TUNSETLINK _IOW('T', 205, int)
#define TUNSETGROUP _IOW('T', 206, int)
+#define TUNGETFEATURES _IOR('T', 207, unsigned int)
/* TUNSETIFF ifr flags */
#define IFF_TUN 0x0001