@@ -1693,6 +1693,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
if (err < 0)
goto err_free_flow;
+ if (ifr->ifr_flags & IFF_ROOT_BLOCK)
+ dev->priv_flags |= IFF_BRIDGE_ROOT_BLOCK;
+
err = register_netdevice(tun->dev);
if (err < 0)
goto err_detach;
@@ -1898,7 +1901,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
* 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 |
- IFF_VNET_HDR | IFF_MULTI_QUEUE,
+ IFF_VNET_HDR | IFF_MULTI_QUEUE |
+ IFF_ROOT_BLOCK,
(unsigned int __user*)argp);
} else if (cmd == TUNSETQUEUE)
return tun_set_queue(file, &ifr);
@@ -73,6 +73,7 @@
/* read-only flag */
#define IFF_PERSIST 0x0800
#define IFF_NOFILTER 0x1000
+#define IFF_ROOT_BLOCK 0x2000
/* Socket options */
#define TUN_TX_TIMESTAMP 1