]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/tun.c
tun: Interface to query tun/tap features.
[linux-2.6-omap-h63xx.git] / drivers / net / tun.c
index 7ab94c825b577f13b606bc938b834db6003559ad..3bb991fd2b512b9bd20bb22066982e03f3b3245a 100644 (file)
@@ -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;