&host, partialOkay) < 0)
goto cleanup;
+ if (!partialOkay &&
+ VIR_SOCKET_ADDR_FAMILY(&ipdef->address)
+ != VIR_SOCKET_ADDR_FAMILY(&host.ip)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("the address family of a host entry IP must match "
+ "the address family of the dhcp element's parent"));
+ goto cleanup;
+ }
+
if (command == VIR_NETWORK_UPDATE_COMMAND_MODIFY) {
/* search for the entry with this (ip|mac|name),
if (virSocketAddrRangeParseXML(def->name, ipdef, ctxt->node, &range) < 0)
goto cleanup;
+ if (VIR_SOCKET_ADDR_FAMILY(&ipdef->address)
+ != VIR_SOCKET_ADDR_FAMILY(&range.start)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("the address family of a dhcp range must match "
+ "the address family of the dhcp element's parent"));
+ goto cleanup;
+ }
+
/* check if an entry with same name/address/ip already exists */
for (i = 0; i < ipdef->nranges; i++) {
if (virSocketAddrEqual(&range.start, &ipdef->ranges[i].start) &&