From af1e2ede261c0f9bf9ef0c09d6e73aefed2bed78 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Tue, 3 Nov 2009 21:01:32 +0100 Subject: [PATCH] Fix improper error return in virInterfaceDefParseProtoIPvX * src/conf/interface_conf.c: the code was erronously returning -1 in the two functions if is not provided --- src/conf/interface_conf.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 18f7cf9493..31abf12890 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -310,10 +310,11 @@ virInterfaceDefParseProtoIPv4(virConnectPtr conn, virInterfaceProtocolDefPtr def def->gateway = tmp; dhcp = virXPathNode(conn, "./dhcp", ctxt); - if (dhcp != NULL) + if (dhcp != NULL) { ret = virInterfaceDefParseDhcp(conn, def, dhcp, ctxt); - if (ret != 0) - return(ret); + if (ret != 0) + return(ret); + } nIpNodes = virXPathNodeSet(conn, "./ip", ctxt, &ipNodes); if (ipNodes == NULL) @@ -366,10 +367,11 @@ virInterfaceDefParseProtoIPv6(virConnectPtr conn, virInterfaceProtocolDefPtr def def->autoconf = 1; dhcp = virXPathNode(conn, "./dhcp", ctxt); - if (dhcp != NULL) + if (dhcp != NULL) { ret = virInterfaceDefParseDhcp(conn, def, dhcp, ctxt); - if (ret != 0) - return(ret); + if (ret != 0) + return(ret); + } nIpNodes = virXPathNodeSet(conn, "./ip", ctxt, &ipNodes); if (ipNodes == NULL) -- 2.39.5