Changeset 138 for trunk/pdns/pdns/resolver.cc
- Timestamp:
- 01/21/03 11:42:34 (10 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/resolver.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/resolver.cc
r116 r138 154 154 makeUDPSocket(); 155 155 DNSPacket p; 156 156 157 p.setQuestion(Opcode::Query,domain,type); 157 158 p.wrapup(); … … 163 164 struct sockaddr_in toaddr; 164 165 struct in_addr inp; 165 Utility::inet_aton(ip.c_str(),&inp); 166 ServiceTuple st; 167 st.port=53; 168 parseService(ip, st); 169 Utility::inet_aton(st.host.c_str(),&inp); 166 170 toaddr.sin_addr.s_addr=inp.s_addr; 167 171 168 toaddr.sin_port=htons( 53);172 toaddr.sin_port=htons(st.port); 169 173 toaddr.sin_family=AF_INET; 170 174 171 175 if(sendto(d_sock, p.getData(), p.len, 0, (struct sockaddr*)(&toaddr), sizeof(toaddr))<0) { 172 throw ResolverException("Unable to ask query of "+ ip+": "+stringerror());176 throw ResolverException("Unable to ask query of "+st.host+":"+itoa(st.port)+": "+stringerror()); 173 177 } 174 178