Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > ebe084c140192657f9094e135a84202c > files > 64

libvirt-0.8.2-29.el5.src.rpm

From 96252e50a7862048d3439ce2ece2951a5877fb21 Mon Sep 17 00:00:00 2001
Message-Id: <96252e50a7862048d3439ce2ece2951a5877fb21.1284409900.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 11 Aug 2010 20:25:09 +0200
Subject: [PATCH] bridge: Add --dhcp-no-override option to dnsmasq

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

--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.
(cherry picked from commit e26672f78661272274580e0653b21017c7c31d4e)
---
 libvirt.spec.in             |    4 ++--
 src/network/bridge_driver.c |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index 0944120..061b87e 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -200,7 +200,7 @@ Requires: %{name}-client = %{version}-%{release}
 Requires: bridge-utils
 %endif
 %if %{with_network}
-Requires: dnsmasq
+Requires: dnsmasq >= 2.41
 Requires: iptables
 %endif
 %if %{with_nwfilter}
@@ -298,7 +298,7 @@ BuildRequires: avahi-devel
 BuildRequires: libselinux-devel
 %endif
 %if %{with_network}
-BuildRequires: dnsmasq
+BuildRequires: dnsmasq >= 2.41
 %endif
 BuildRequires: bridge-utils
 %if %{with_sasl}
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index b3f39de..b62e52f 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -427,6 +427,8 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
         (2 * network->def->nranges) + /* --dhcp-range 10.0.0.2,10.0.0.254 */
         /* --dhcp-lease-max=xxx if needed */
         (network->def->nranges ? 1 : 0) +
+        /* --dhcp-no-override if needed */
+        (network->def->nranges ? 1 : 0) +
         /* --dhcp-hostsfile=/var/lib/dnsmasq/$NAME.hostsfile */
         (network->def->nhosts > 0 ? 1 : 0) +
         /* --enable-tftp --tftp-root /srv/tftp */
@@ -497,6 +499,7 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
     if (network->def->nranges > 0) {
         snprintf(buf, sizeof(buf), "--dhcp-lease-max=%d", nbleases);
         APPEND_ARG(*argv, i++, buf);
+        APPEND_ARG(*argv, i++, "--dhcp-no-override");
     }
 
     if (network->def->nhosts > 0) {
-- 
1.7.2.2