The current logic of lxcNetworkParseData uses one single structure to record data over the network definitions inside config files. The logic consider the entry 'type' as a new network definition, every time that algorithm find this tag. This new structure was designed to consider network definitions as an array of network structures. Signed-off-by: Julio Faracco <jcfaracco@xxxxxxxxx> --- src/lxc/lxc_native.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 2fd349ac1d..bf82cd1e98 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -423,8 +423,9 @@ lxcCreateHostdevDef(int mode, int type, const char *data) return hostdev; } -typedef struct { - virDomainDefPtr def; +typedef struct _lxcNetworkParseData lxcNetworkParseData; +typedef lxcNetworkParseData *lxcNetworkParseDataPtr; +struct _lxcNetworkParseData { char *type; char *link; char *mac; @@ -436,9 +437,14 @@ typedef struct { size_t nips; char *gateway_ipv4; char *gateway_ipv6; - bool privnet; - size_t networks; -} lxcNetworkParseData; + size_t index; +}; + +typedef struct { + lxcNetworkParseDataPtr *data; + size_t nnetworks; +} lxcNetworkParseArray; + static int lxcAddNetworkRouteDefinition(const char *address, -- 2.19.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list