[Devel] [PATCH rh7 v2] tun: expose "owner", "group" and "tun_flags" attributes in container

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Wed Nov 25 06:36:32 PST 2015


https://jira.sw.ru/browse/PSBM-39726

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 drivers/net/tun.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index dd14140..e6735c8 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1742,10 +1742,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 		if (err < 0)
 			goto err_detach;
 
-		if ((dev_net(tun->dev) == &init_net) &&
-		    (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
+		if (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
 		    device_create_file(&tun->dev->dev, &dev_attr_owner) ||
-		    device_create_file(&tun->dev->dev, &dev_attr_group)))
+		    device_create_file(&tun->dev->dev, &dev_attr_group))
 			pr_err("Failed to create tun sysfs files\n");
 	}
 



More information about the Devel mailing list