]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix issue reported by Sten Spans: we don't always bind to query-local-address for...
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 10 Jun 2008 19:57:53 +0000 (19:57 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 10 Jun 2008 19:57:53 +0000 (19:57 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1190 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/lwres.cc

index 169144be83d8f5fc5ff61e99936827cbfd4cf751..6cc7ff6ef8a1b812c130568eaf56ff38da3f2e01 100644 (file)
@@ -99,6 +99,12 @@ int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool do
       Socket s(InterNetwork, Stream);
       IPEndpoint ie(U32ToIP(ntohl(ip.sin4.sin_addr.s_addr)), 53);   // WRONG WRONG WRONG XXX FIXME
       s.setNonBlocking();
+      string bindIP=::arg()["query-local-address"];
+      if(!bindIP.empty()) {
+       ComboAddress local(bindIP);
+       s.bind(local.sin4);
+      }
+
       s.connect(ie);
       
       uint16_t tlen=htons(vpacket.size());