提交 4af71829 编写于 作者: D Daniel P. Berrange

Don't try to parse a NULL ip address for boot server

The boot server IP address is optional, so it needs to be
checked before attempting to parse it.

* src/conf/network_conf.c: Don't parse NULL ip address for
  boot server
上级 090404ac
......@@ -317,6 +317,7 @@ virNetworkDHCPRangeDefParseXML(virNetworkDefPtr def,
xmlChar *file;
xmlChar *server;
virSocketAddr inaddr;
memset(&inaddr, 0, sizeof(inaddr));
if (!(file = xmlGetProp(cur, BAD_CAST "file"))) {
cur = cur->next;
......@@ -324,7 +325,8 @@ virNetworkDHCPRangeDefParseXML(virNetworkDefPtr def,
}
server = xmlGetProp(cur, BAD_CAST "server");
if (virSocketParseAddr((const char *)server, &inaddr, AF_UNSPEC) < 0)
if (server &&
virSocketParseAddr((const char *)server, &inaddr, AF_UNSPEC) < 0)
return -1;
def->bootfile = (char *)file;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册