提交 43d635ca 编写于 作者: L Laine Stump

conf: return immediately on error in dhcp host element

If an error was encountered parsing a dhcp host entry mac address or
name, parsing would continue and log a less descriptive error that
might make it more difficult to notice the true nature of the problem.

This patch returns immediately on logging the first error.
上级 5d571045
......@@ -430,13 +430,16 @@ virNetworkDHCPRangeDefParseXML(const char *networkName,
_("Cannot parse MAC address '%s' in network '%s'"),
mac, networkName);
VIR_FREE(mac);
return -1;
}
name = virXMLPropString(cur, "name");
if ((name != NULL) && (!c_isalpha(name[0]))) {
virNetworkReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot use name address '%s' in network '%s'"),
name, networkName);
VIR_FREE(mac);
VIR_FREE(name);
return -1;
}
/*
* You need at least one MAC address or one host name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册