Changeset 1190

Show
Ignore:
Timestamp:
06/10/08 21:57:53 (4 months ago)
Author:
ahu
Message:

fix issue reported by Sten Spans: we don't always bind to query-local-address for outgoing TCP queries

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/lwres.cc

    r1178 r1190  
    100100      IPEndpoint ie(U32ToIP(ntohl(ip.sin4.sin_addr.s_addr)), 53);   // WRONG WRONG WRONG XXX FIXME 
    101101      s.setNonBlocking(); 
     102      string bindIP=::arg()["query-local-address"]; 
     103      if(!bindIP.empty()) { 
     104        ComboAddress local(bindIP); 
     105        s.bind(local.sin4); 
     106      } 
     107 
    102108      s.connect(ie); 
    103109