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 <jcfara...@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to