Overview
Features
Download
Documentation
Community
Add-Ons & Services

Poco::Net::DNS and ipv6

Please post support and help requests here.

Re: Poco::Net::DNS and ipv6

Postby jbb » 09 Apr 2009, 19:10

I had to slightly modify the code to get it to work (just removing some & operations) but I can confirm that this now works perfectly with IPv6 on vista and the test program above now lists both my IPv4 and IPv6 addresses correctly. I've pasted the code below from my working version to reduce the chance of typos creeping in.

I've tested this on windows vista. I should be able to test it on a ipv6 connected linux system over the weekend.

Code: Select all
HostEntry::HostEntry(struct addrinfo* ainfo)
{
   poco_check_ptr (ainfo);
   
   for (struct addrinfo* ai = ainfo; ai; ai = ai->ai_next)
   {
      if (ai->ai_canonname)
         _name.assign(ai->ai_canonname);
      else if (ai->ai_addrlen && ai->ai_addr)
      {
         switch(ai->ai_addr->sa_family)
         {
         case AF_INET:
            _addresses.push_back(IPAddress(&reinterpret_cast<sockaddr_in*>(ai->ai_addr)->sin_addr, sizeof(in_addr)));
            break;
         case AF_INET6:
            _addresses.push_back(IPAddress(&reinterpret_cast<sockaddr_in6*>(ai->ai_addr)->sin6_addr, sizeof(in6_addr)));
            break;
         }
      }
   }
}


The next problem is that none of the name lookup functions return any ipv6 addresses when i call them. I'll look into that next :)
jbb
 
Posts: 9
Joined: 04 Apr 2009, 13:28

Re: Poco::Net::DNS and ipv6

Postby guenter » 16 Apr 2009, 17:51

I have fixed some more bugs, and when compiling with IPv6 support on my (non IPv6) Windows system, the testsuite now successfully runs through. Feedback from a real IPv6 system would be welcome.

You will find the changes in the 1.3.4 SVN branch later this evening.
guenter
 
Posts: 1092
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Poco::Net::DNS and ipv6

Postby jbb » 16 Apr 2009, 18:29

I will download and do what testing I can some time in the next few days.
I intend to do more testing on a linux system too but have had limited time so far.
Thank you for the updates
jbb
 
Posts: 9
Joined: 04 Apr 2009, 13:28

Re: Poco::Net::DNS and ipv6

Postby alex » 16 Apr 2009, 23:15

jbb wrote:I will download and do what testing I can some time in the next few days.
I intend to do more testing on a linux system too but have had limited time so far.


It is best if you submit the changes through sourceforge tracker (preferably as diffs). If you want SVN write access, email us.

Thanks for your help.
alex
 
Posts: 1047
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Poco::Net::DNS and ipv6

Postby jbb » 19 Apr 2009, 23:17

I have done some limited testing on my vista ipv6 connection and can confirm that
DNS::thisHost correctly returns all of my ipv4 and ipv6 addresses.
DNS::resolve returns ipv4, ipv6 and both when a host has both kinds of address.

I'm able to make a HTTPClientSession request to ipv6.google.com and retrieve data over it.

So it looks like most of it works correctly on windows at least. I have no need for server sockets at the moment but will try to do some testing on that too.

Thank you for the updates :)
jbb
 
Posts: 9
Joined: 04 Apr 2009, 13:28

Previous

Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest