From: Bert Hubert Date: Tue, 10 Jun 2008 19:57:53 +0000 (+0000) Subject: fix issue reported by Sten Spans: we don't always bind to query-local-address for... X-Git-Tag: rec-3.1.7.1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ac2a2ab00aa70de12125ab8252da314dbf44be4;p=thirdparty%2Fpdns.git fix issue reported by Sten Spans: we don't always bind to query-local-address for outgoing TCP queries git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1190 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/lwres.cc b/pdns/lwres.cc index 169144be83..6cc7ff6ef8 100644 --- a/pdns/lwres.cc +++ b/pdns/lwres.cc @@ -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());