提交 bc5b270c 编写于 作者: L Laine Stump

network: fix indentation of networkDnsmasqConfContents

Somehow I managed to push the changes to this file with improper
indentation. This patch just re-indents, reformats the comment lines,
and re-groups a couple of multi-line strings so that they fit within
80 columns. The resulting binary should be identical.
上级 ff93b865
......@@ -721,6 +721,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
if (!ipaddr)
goto cleanup;
/* also part of CVE 2012-3411 - if the host's version of
* dnsmasq doesn't have bind-dynamic, only allow listening on
* private/local IP addresses (see RFC1918/RFC3484/RFC4193)
......@@ -730,13 +731,16 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Publicly routable address %s is prohibited. "
"The version of dnsmasq on this host (%d.%d) doesn't "
"support the bind-dynamic option, which is required "
"for safe operation on a publicly routable subnet "
"(see CVE-2012-3411). You must either upgrade dnsmasq, "
"or use a private/local subnet range for this network "
"(as described in RFC1918/RFC3484/RFC4193)."), ipaddr,
(int)version / 1000000, (int)(version % 1000000) / 1000);
"The version of dnsmasq on this host (%d.%d) "
"doesn't support the bind-dynamic option, "
"which is required for safe operation on a "
"publicly routable subnet "
"(see CVE-2012-3411). You must either "
"upgrade dnsmasq, or use a private/local "
"subnet range for this network "
"(as described in RFC1918/RFC3484/RFC4193)."),
ipaddr, (int)version / 1000000,
(int)(version % 1000000) / 1000);
goto cleanup;
}
virBufferAsprintf(&configbuf, "listen-address=%s\n", ipaddr);
......@@ -811,8 +815,8 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
if (ipdef->nranges || ipdef->nhosts) {
if (ipv4def) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("For IPv4, multiple DHCP definitions cannot "
"be specified."));
_("For IPv4, multiple DHCP definitions "
"cannot be specified."));
goto cleanup;
} else {
ipv4def = ipdef;
......@@ -824,17 +828,21 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
if (!DNSMASQ_DHCPv6_SUPPORT(caps)) {
unsigned long version = dnsmasqCapsGetVersion(caps);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("The version of dnsmasq on this host (%d.%d) doesn't "
"adequately support IPv6 dhcp range or dhcp host "
"specification. Version %d.%d or later is required."),
(int)version / 1000000, (int)(version % 1000000) / 1000,
DNSMASQ_DHCPv6_MAJOR_REQD, DNSMASQ_DHCPv6_MINOR_REQD);
_("The version of dnsmasq on this host "
"(%d.%d) doesn't adequately support "
"IPv6 dhcp range or dhcp host "
"specification. Version %d.%d or later "
"is required."),
(int)version / 1000000,
(int)(version % 1000000) / 1000,
DNSMASQ_DHCPv6_MAJOR_REQD,
DNSMASQ_DHCPv6_MINOR_REQD);
goto cleanup;
}
if (ipv6def) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("For IPv6, multiple DHCP definitions cannot "
"be specified."));
_("For IPv6, multiple DHCP definitions "
"cannot be specified."));
goto cleanup;
} else {
ipv6def = ipdef;
......@@ -875,9 +883,10 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
}
/*
* For static-only DHCP, i.e. with no range but at least one host element,
* we have to add a special --dhcp-range option to enable the service in
* dnsmasq. (this is for dhcp-hosts= support)
* For static-only DHCP, i.e. with no range but at least one
* host element, we have to add a special --dhcp-range option
* to enable the service in dnsmasq. (this is for dhcp-hosts=
* support)
*/
if (!ipdef->nranges && ipdef->nhosts) {
char *bridgeaddr = virSocketAddrFormat(&ipdef->address);
......@@ -942,8 +951,8 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
virBufferAsprintf(&configbuf, "dhcp-hostsfile=%s\n",
dctx->hostsfile->path);
/* Likewise, always create this file and put it on the commandline, to allow for
* for runtime additions.
/* Likewise, always create this file and put it on the
* commandline, to allow for runtime additions.
*/
virBufferAsprintf(&configbuf, "addn-hosts=%s\n",
dctx->addnhostsfile->path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册