提交 b62b8090 编写于 作者: M Michal Privoznik

qemu: Check for down limit of SLIRP prefix too

https://bugzilla.redhat.com/show_bug.cgi?id=1515533

We're already checking if IPv4 prefix isn't too long. But we are
not checking if it isn't too short. QEMU supports prefixes longer
than 4 (including). I haven't find anything similar related to
IPv6 in qemu sources.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 9cae9c82
...@@ -3873,9 +3873,9 @@ qemuDomainDeviceDefValidateNetwork(const virDomainNetDef *net) ...@@ -3873,9 +3873,9 @@ qemuDomainDeviceDefValidateNetwork(const virDomainNetDef *net)
} }
hasIPv4 = true; hasIPv4 = true;
if (ip->prefix > 27) { if (ip->prefix < 4 || ip->prefix > 27) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("prefix too long")); _("invalid prefix, must be in range of 4-27"));
return -1; return -1;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册