提交 e26672f7 编写于 作者: J Jiri Denemark

bridge: Add --dhcp-no-override option to dnsmasq

--dhcp-no-override description from dnsmasq man page:

      Disable  re-use  of  the  DHCP servername and filename fields as
      extra option space. If it can, dnsmasq moves the boot server and
      filename  information  (from  dhcp-boot)  out of their dedicated
      fields into DHCP options. This make extra space available in the
      DHCP  packet  for options but can, rarely, confuse old or broken
      clients. This flag forces "simple and safe" behaviour  to  avoid
      problems in such a case.

It seems some virtual network card ROMs are this old/buggy so let's add
--dhcp-no-override as a workaround for them. We don't use extra DHCP
options so this should be safe. The option was added in dnsmasq-2.41,
which becomes the minimum required version.
上级 145d6cb0
...@@ -200,7 +200,7 @@ Requires: %{name}-client = %{version}-%{release} ...@@ -200,7 +200,7 @@ Requires: %{name}-client = %{version}-%{release}
Requires: bridge-utils Requires: bridge-utils
%endif %endif
%if %{with_network} %if %{with_network}
Requires: dnsmasq Requires: dnsmasq >= 2.41
Requires: iptables Requires: iptables
%endif %endif
%if %{with_nwfilter} %if %{with_nwfilter}
...@@ -298,7 +298,7 @@ BuildRequires: avahi-devel ...@@ -298,7 +298,7 @@ BuildRequires: avahi-devel
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
%endif %endif
%if %{with_network} %if %{with_network}
BuildRequires: dnsmasq BuildRequires: dnsmasq >= 2.41
%endif %endif
BuildRequires: bridge-utils BuildRequires: bridge-utils
%if %{with_sasl} %if %{with_sasl}
......
...@@ -427,6 +427,8 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network, ...@@ -427,6 +427,8 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
(2 * network->def->nranges) + /* --dhcp-range 10.0.0.2,10.0.0.254 */ (2 * network->def->nranges) + /* --dhcp-range 10.0.0.2,10.0.0.254 */
/* --dhcp-lease-max=xxx if needed */ /* --dhcp-lease-max=xxx if needed */
(network->def->nranges ? 1 : 0) + (network->def->nranges ? 1 : 0) +
/* --dhcp-no-override if needed */
(network->def->nranges ? 1 : 0) +
/* --dhcp-hostsfile=/var/lib/dnsmasq/$NAME.hostsfile */ /* --dhcp-hostsfile=/var/lib/dnsmasq/$NAME.hostsfile */
(network->def->nhosts > 0 ? 1 : 0) + (network->def->nhosts > 0 ? 1 : 0) +
/* --enable-tftp --tftp-root /srv/tftp */ /* --enable-tftp --tftp-root /srv/tftp */
...@@ -497,6 +499,7 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network, ...@@ -497,6 +499,7 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
if (network->def->nranges > 0) { if (network->def->nranges > 0) {
snprintf(buf, sizeof(buf), "--dhcp-lease-max=%d", nbleases); snprintf(buf, sizeof(buf), "--dhcp-lease-max=%d", nbleases);
APPEND_ARG(*argv, i++, buf); APPEND_ARG(*argv, i++, buf);
APPEND_ARG(*argv, i++, "--dhcp-no-override");
} }
if (network->def->nhosts > 0) { if (network->def->nhosts > 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册