From fb659e6576d57a709e78018a7b320941fa042a0a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 3 Jul 2008 03:45:32 -0700 Subject: [PATCH] --- yaml --- r: 103216 b: refs/heads/master c: 07240fd0902c872f044f523893364a1a24c9f278 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/tun.c | 8 ++++++++ trunk/include/linux/if_tun.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6d7b5e11a25d..675193284668 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44d28ab19c64d095314ac66f765d0c747519f4ed +refs/heads/master: 07240fd0902c872f044f523893364a1a24c9f278 diff --git a/trunk/drivers/net/tun.c b/trunk/drivers/net/tun.c index 7ab94c825b57..3bb991fd2b51 100644 --- a/trunk/drivers/net/tun.c +++ b/trunk/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/trunk/include/linux/if_tun.h b/trunk/include/linux/if_tun.h index 18f31b6187a3..94f76a112303 100644 --- a/trunk/include/linux/if_tun.h +++ b/trunk/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