Fix improper error return in virInterfaceDefParseProtoIPvX

* src/conf/interface_conf.c: the code was erronously returning -1
  in the two functions if <dhcp> is not provided
This commit is contained in:
Laine Stump 2009-11-03 21:01:32 +01:00 committed by Daniel Veillard
parent 468439854b
commit af1e2ede26

View File

@ -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)