]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/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)
committerEric Blake <eblake@redhat.com>
Wed, 22 Aug 2012 17:36:39 +0000 (11:36 -0600)
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!

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 cea91c9af7f6b0aea87ac55c74092b68637d26f7..3a961c9a4c30d2cda79b2cadd71234676b9cea91 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -260,6 +260,7 @@ Patches have also been contributed by:
   Thomas Woerner       <twoerner@redhat.com>
   J.B. Joret           <jb@linux.vnet.ibm.com>
   Stefan Hajnoczi      <stefanha@linux.vnet.ibm.com>
+  Gene Czarcinski      <gene@czarc.net>
 
   [....send patches to get your name here....]
 
index 7144589b72eeb5e69d102ad1dc04f5783c9279dc..78662876a566915210d25c5c30af3a4b9d6000d8 100644 (file)
@@ -539,7 +539,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\