mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
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:
parent
468439854b
commit
af1e2ede26
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user