]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
dnsmasq: avoid forwarding queries without a domain
authorGene Czarcinski <gene@czarc.net>
Wed, 22 Aug 2012 16:59:24 +0000 (12:59 -0400)
committerCole Robinson <crobinso@redhat.com>
Sun, 7 Oct 2012 20:49:51 +0000 (16:49 -0400)
dnsmasq is forwarding a number of queries upstream that should not
be done.  There still remains an MX query for a plain name with no
domain specified that will be forwarded is dnsmasq has --domain=xxx
--local=/xxx/ specified. This does not happen with no domain name
and --local=// ... not a libvirt problem.

BTW, thanks again to Claudio Bley!
(cherry picked from commit f3868259ca0517212e439a65c9060868f673b6c9)

Conflicts:
AUTHORS

AUTHORS
src/network/bridge_driver.c
tests/networkxml2argvdata/isolated-network.argv
tests/networkxml2argvdata/nat-network-dns-hosts.argv
tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
tests/networkxml2argvdata/nat-network-dns-srv-record.argv
tests/networkxml2argvdata/nat-network-dns-txt-record.argv
tests/networkxml2argvdata/nat-network.argv
tests/networkxml2argvdata/netboot-network.argv
tests/networkxml2argvdata/netboot-proxy-network.argv
tests/networkxml2argvdata/routed-network.argv

diff --git a/AUTHORS b/AUTHORS
index 76fa3cd2d82350b87cb266506b034f4f858c277b..41e6bd55ca6a1ac1238e54064e86140cc961fd36 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -241,6 +241,7 @@ Patches have also been contributed by:
   Thang Pham           <thang.pham@us.ibm.com>
   Eiichi Tsukata       <eiichi.tsukata.xh@hitachi.com>
   Wido den Hollander   <wido@widodh.nl>
+  Gene Czarcinski      <gene@czarc.net>
 
   [....send patches to get your name here....]
 
index d82212f91d5c8e5499f4685dfbdbab92393cce11..f66718a42c0b43c4669b4c057e863830153af272 100644 (file)
@@ -491,7 +491,11 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
     virCommandAddArgList(cmd, "--strict-order", "--bind-interfaces", NULL);
 
     if (network->def->domain)
-        virCommandAddArgList(cmd, "--domain", network->def->domain, NULL);
+        virCommandAddArgPair(cmd, "--domain", network->def->domain);
+    /* need to specify local even if no domain specified */
+    virCommandAddArgFormat(cmd, "--local=/%s/",
+                           network->def->domain ? network->def->domain : "");
+    virCommandAddArgList(cmd, "--domain-needed", "--filterwin2k", NULL);
 
     if (pidfile)
         virCommandAddArgPair(cmd, "--pid-file", pidfile);
index a9beb05911fd5b3bccb24bc2aeec30166a87c33c..276f42a4f66fc3cab6a6274cd0298d38e4a4ae00 100644 (file)
@@ -1,4 +1,5 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
 --except-interface lo --dhcp-option=3 --no-resolv \
 --listen-address 192.168.152.1 \
 --dhcp-range 192.168.152.2,192.168.152.254 \
index c7e496797df6fbc2185792096986ad4d0dffd6cb..8040e2ae83ce76650945db70e7cf53a1e297d83c 100644 (file)
@@ -1,3 +1,4 @@
-@DNSMASQ@ --strict-order --bind-interfaces --domain example.com \
+@DNSMASQ@ --strict-order --bind-interfaces --domain=example.com \
+--local=/example.com/ --domain-needed --filterwin2k \
 --conf-file= --except-interface lo --listen-address 192.168.122.1 \
 --expand-hosts --addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
index ea1da6d5f8984a717c3d2f302bb6e1ae716a4d10..bb50fd6ddcd92cff056babd130f01c4b0f820084 100644 (file)
@@ -1,7 +1,7 @@
 @DNSMASQ@ \
 --strict-order \
 --bind-interfaces \
---conf-file= \
+--local=// --domain-needed --filterwin2k --conf-file= \
 --except-interface lo \
 --srv-host=name.tcp.,,,, \
 --listen-address 192.168.122.1 \
index 84c2d2f60d50fef2bd836519a60dcb02b640eb3f..36498f22334fdcaeda4c3a8ee8b1c98b8725da13 100644 (file)
@@ -1,7 +1,7 @@
 @DNSMASQ@ \
 --strict-order \
 --bind-interfaces \
---conf-file= \
+--local=// --domain-needed --filterwin2k --conf-file= \
 --except-interface lo \
 --srv-host=name.tcp.test-domain-name,.,1024,10,10 \
 --listen-address 192.168.122.1 \
index bed309ffe6c6dcc45698f261be83e9e8da68241e..1b318716e5ba305bf95a325f6947c4550de044c5 100644 (file)
@@ -1,4 +1,5 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
 --except-interface lo --txt-record=example,example value \
 --listen-address 192.168.122.1 --listen-address 192.168.123.1 \
 --listen-address 2001:db8:ac10:fe01::1 \
index 80878a8eb0052fd30d2325d45a0c0eafccc6a4d0..265b931980f985bad5f8040edeca1a54fc582e1b 100644 (file)
@@ -1,4 +1,5 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
 --except-interface lo --listen-address 192.168.122.1 \
 --listen-address 192.168.123.1 --listen-address 2001:db8:ac10:fe01::1 \
 --listen-address 2001:db8:ac10:fd01::1 --listen-address 10.24.10.1 \
index 7ae5b75bc60a34daccaa9aa0f7ffa039065a2991..4f998d576c592946d14063bda33a9a7ea4bdbe6f 100644 (file)
@@ -1,5 +1,6 @@
-@DNSMASQ@ --strict-order --bind-interfaces --domain example.com \
---conf-file= --except-interface lo --listen-address 192.168.122.1 \
+@DNSMASQ@ --strict-order --bind-interfaces --domain=example.com \
+--local=/example.com/ --domain-needed --filterwin2k --conf-file= \
+--except-interface lo --listen-address 192.168.122.1 \
 --dhcp-range 192.168.122.2,192.168.122.254 \
 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
 --dhcp-lease-max=253 --dhcp-no-override --expand-hosts --enable-tftp \
index 2c5a0d53397efbb1163bcb179a72d91879819b5f..89319ef4fe56ff1a344b83ad27088116d028f430 100644 (file)
@@ -1,5 +1,6 @@
-@DNSMASQ@ --strict-order --bind-interfaces --domain example.com \
---conf-file= --except-interface lo --listen-address 192.168.122.1 \
+@DNSMASQ@ --strict-order --bind-interfaces --domain=example.com \
+--local=/example.com/ --domain-needed --filterwin2k --conf-file= \
+--except-interface lo --listen-address 192.168.122.1 \
 --dhcp-range 192.168.122.2,192.168.122.254 \
 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
 --dhcp-lease-max=253 --dhcp-no-override --expand-hosts \
index 75303e6ee491e285321084ffadc702b8c2ce7fa4..ac439911780b5a3278c6f812a1eb93b60a683f5b 100644 (file)
@@ -1,2 +1,3 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
 --except-interface lo --listen-address 192.168.122.1\