Nmap Development mailing list archives
Re: IPv6 mass_dns and nsock_connect_udp
From: jah <jah () zadkiel plus com>
Date: Wed, 03 Dec 2008 02:19:54 +0000
On 03/12/2008 01:06, Kris Katterjohn wrote:
On 12/02/2008 06:28 PM, jah wrote:Hi folks,Hey jah,I'm making some progress with a little project to allow mass_rdns to do lookups for IPv6 addresses (async code rather than the system resolver) and to connect to an IPv6 socket on dns servers - I'm using MS Visual C++ EE.I've changed a member of the struct dns_server_s from sockaddr_in to sockaddr_storage and hit a snag after connect_dns_servers() calls nsock_connect_udp().Previously, connect_dns_servers passed a reference to a dns_server_s sockaddr_in casted to a pointer to a sockaddr along with sizeof(struct sockaddr) which are defined as saddr and sslen respectively in nsock_connect_udp. saddr is then casted to pointer to a sockaddr_storage, but sslen remains unchanged:Instead of passing "sizeof(struct sockaddr)" for sslen, you should pass in the size of the struct you're using. So pass in "sizeof(struct sockaddr_in)" for IPv4 or "sizeof(struct sockaddr_in6)" for IPv6. The current use of sockaddr{} works because both it and sockaddr_in{} should always be the same size (look at the sin_zero field of the latter).
Thanks for that Guys, most helpful. I think what I need to do is add an addr_len member to dns_server_s which will be set to the correct size by resolve() in tcpip.cc and I can then pass that to nsock_connect_udp(). So far I've seen sslen to be 10 for an IPv4 address and 28 (not 128!) for an IPv6 one - this seems sane and it certainly works: mass_rdns: Using DNS server 2001:a88:0:fffa::1 mass_rdns: OK MATCHED <2001:a88:0:fffa::1> to <ns0.ipv6.claradns.net> Completed Parallel DNS resolution of 1 host. at 02:16, 0.03s elapsed Thanks again. jah _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
Current thread:
- IPv6 mass_dns and nsock_connect_udp jah (Dec 02)
- Re: IPv6 mass_dns and nsock_connect_udp Kris Katterjohn (Dec 02)
- Re: IPv6 mass_dns and nsock_connect_udp David Fifield (Dec 02)
- Re: IPv6 mass_dns and nsock_connect_udp Kris Katterjohn (Dec 02)
- Re: IPv6 mass_dns and nsock_connect_udp jah (Dec 02)
- Re: IPv6 mass_dns and nsock_connect_udp David Fifield (Dec 02)
- Re: IPv6 mass_dns and nsock_connect_udp Kris Katterjohn (Dec 02)