[Devel] [PATCH RHEL7 COMMIT] vzprivnet6: Interpret zero address as internet

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 24 08:53:42 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.10.1.vz7.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.10.1.vz7.12.3
------>
commit 846efe377daddb1242d1dd0d2e0f273ba87fc9c9
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Thu Mar 24 19:53:42 2016 +0400

    vzprivnet6: Interpret zero address as internet
    
    Port diff-vzprivnet6-INADDR6_ANY-is-internet
      VZPRIV6NET: interpret zero address as internet
    
      Ported from rh5
    
      If netfilter receives zero address ("0::0") then radix tree will be
      returned.
      But root node doesn't have private network. This patch fixes this
      problem: root
      node (i.e. address "0:0") is interpreted as a part of "internet" private
      network.
    
      https://jira.sw.ru:9443/browse/PSBM-8734
    
      Signed-off-by: Stanislav Kinsbursky <skinsbursky at parallels.com>
      Signed-off-by: Andrey Vagin <avagin at openvz.org>
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 net/ipv6/netfilter/ip6_vzprivnet.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/netfilter/ip6_vzprivnet.c b/net/ipv6/netfilter/ip6_vzprivnet.c
index fdba434..f8924e9 100644
--- a/net/ipv6/netfilter/ip6_vzprivnet.c
+++ b/net/ipv6/netfilter/ip6_vzprivnet.c
@@ -40,10 +40,15 @@ struct vzprivnet6_node
 	__u16			fn_flags;
 };
 
+struct vzprivnet internet = {
+	.weak = VZPRIVNET_INET,
+};
+
 #define RTN_RTINFO		1
 
 static struct vzprivnet_entry sparse6_null_entry = {
 	.preflen = 128,
+	.pn = &internet,
 };
 
 static struct vzprivnet6_node sparse6_root_node = {
@@ -53,6 +58,7 @@ static struct vzprivnet6_node sparse6_root_node = {
 
 static struct vzprivnet_entry legacy6_null_entry = {
 	.preflen = 128,
+	.pn = &internet,
 };
 
 static struct vzprivnet6_node legacy6_root_node = {
@@ -117,10 +123,6 @@ static struct vzprivnet6_node * radix_tree_search(struct vzprivnet6_node *root,
 	return NULL;
 }
 
-struct vzprivnet internet = {
-	.weak = VZPRIVNET_INET,
-};
-
 static struct vzprivnet_entry *vzprivnet6_lookup(struct vzprivnet6_node *root,
 						u32 *ip)
 {


More information about the Devel mailing list