[Devel] [PATCH RHEL7 COMMIT] venet: Dont create venet-s in sub net namespaces (v2)

Konstantin Khorenko khorenko at odin.com
Tue Apr 28 08:00:38 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.el7.ovz.4.8
------>
commit 1808194996b32fa64ea43aef8eceb6da7b17f073
Author: Cyrill Gorcunov <gorcunov at parallels.com>
Date:   Tue Apr 28 19:00:38 2015 +0400

    venet: Dont create venet-s in sub net namespaces (v2)
    
    Patch diff-venet-dont-create-venet-s-in-sub-net-namespaces
    ported from RHEL6-based.
    
    Docker don't need venet inteterfaces in sub net namespaces.
    
    v2: Don't create venet if ve->netns isn't equal to the current netns
    
    https://jira.sw.ru/browse/PSBM-29811
    
    Signed-off-by: Andrew Vagin <avagin at openvz.org>
    Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
    Reviewed-by: Vladimir Davydov <vdavydov at odin.com>
    
    vdavydov@: this patch fixes 'unshare -n' failing with EEXIST.
---
 drivers/net/venetdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/venetdev.c b/drivers/net/venetdev.c
index 20729d0..d4c3fa9 100644
--- a/drivers/net/venetdev.c
+++ b/drivers/net/venetdev.c
@@ -1086,6 +1086,11 @@ static __net_init int venet_init_net(struct net *net)
 	int err;
 
 	env = get_exec_env();
+	if (env->ve_netns && net != env->ve_netns) {
+		/* Don't create venet-s in sub net namespaces */
+		return 0;
+	}
+
 	if (env->veip)
 		return -EEXIST;
 



More information about the Devel mailing list