mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-26 07:04:42 +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;
|
def->gateway = tmp;
|
||||||
|
|
||||||
dhcp = virXPathNode(conn, "./dhcp", ctxt);
|
dhcp = virXPathNode(conn, "./dhcp", ctxt);
|
||||||
if (dhcp != NULL)
|
if (dhcp != NULL) {
|
||||||
ret = virInterfaceDefParseDhcp(conn, def, dhcp, ctxt);
|
ret = virInterfaceDefParseDhcp(conn, def, dhcp, ctxt);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return(ret);
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
nIpNodes = virXPathNodeSet(conn, "./ip", ctxt, &ipNodes);
|
nIpNodes = virXPathNodeSet(conn, "./ip", ctxt, &ipNodes);
|
||||||
if (ipNodes == NULL)
|
if (ipNodes == NULL)
|
||||||
@ -366,10 +367,11 @@ virInterfaceDefParseProtoIPv6(virConnectPtr conn, virInterfaceProtocolDefPtr def
|
|||||||
def->autoconf = 1;
|
def->autoconf = 1;
|
||||||
|
|
||||||
dhcp = virXPathNode(conn, "./dhcp", ctxt);
|
dhcp = virXPathNode(conn, "./dhcp", ctxt);
|
||||||
if (dhcp != NULL)
|
if (dhcp != NULL) {
|
||||||
ret = virInterfaceDefParseDhcp(conn, def, dhcp, ctxt);
|
ret = virInterfaceDefParseDhcp(conn, def, dhcp, ctxt);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return(ret);
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
nIpNodes = virXPathNodeSet(conn, "./ip", ctxt, &ipNodes);
|
nIpNodes = virXPathNodeSet(conn, "./ip", ctxt, &ipNodes);
|
||||||
if (ipNodes == NULL)
|
if (ipNodes == NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user