[libvirt] [PATCH 1/2] lxc: Initializing IPv6 and IPv4 gateway to overwrite old settings.

Julio Faracco jcfaracco at gmail.com
Wed Nov 28 03:24:37 UTC 2018


This commit fixes a bug when you have multiple network settings defined.
Basically, if you set an IPv6 or IPv4 gateway, it carries on next
network settings. It is happening because the data is not being
initialized when a new network type is defined. So, the old data still
persists into the pointer.

Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
---
 src/lxc/lxc_native.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 9f6d4b3de8..0c9b315459 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -583,6 +583,9 @@ lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data)
         parseData->ips = NULL;
         parseData->nips = 0;
 
+	parseData->gateway_ipv4 = NULL;
+	parseData->gateway_ipv6 = NULL;
+
         /* Keep the new value */
         parseData->type = value->str;
     }
-- 
2.19.1




More information about the libvir-list mailing list