aboutsummaryrefslogtreecommitdiffstats
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 7ab94c825b57..3bb991fd2b51 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,
640 return 0; 640 return 0;
641 } 641 }
642 642
643 if (cmd == TUNGETFEATURES) {
644 /* Currently this just means: "what IFF flags are valid?".
645 * This is needed because we never checked for invalid flags on
646 * TUNSETIFF. */
647 return put_user(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE,
648 (unsigned int __user*)argp);
649 }
650
643 if (!tun) 651 if (!tun)
644 return -EBADFD; 652 return -EBADFD;
645 653
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 18f31b6187a3..94f76a112303 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -40,6 +40,7 @@
40#define TUNSETOWNER _IOW('T', 204, int) 40#define TUNSETOWNER _IOW('T', 204, int)
41#define TUNSETLINK _IOW('T', 205, int) 41#define TUNSETLINK _IOW('T', 205, int)
42#define TUNSETGROUP _IOW('T', 206, int) 42#define TUNSETGROUP _IOW('T', 206, int)
43#define TUNGETFEATURES _IOR('T', 207, unsigned int)
43 44
44/* TUNSETIFF ifr flags */ 45/* TUNSETIFF ifr flags */
45#define IFF_TUN 0x0001 46#define IFF_TUN 0x0001