Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1239 (reopened enhancement)

Opened 11 years ago

Last modified 9 years ago

IPv6 support

Reported by: Deewiant Assigned to: kris
Priority: normal Milestone: 1.0
Component: Core Functionality Version: trunk
Keywords: Cc: wazar

Description and co. don't support IPv6.

A guide on porting to IPv6 which might be helpful to whoever decides to do something about this:


socket.patch (23.4 kB) - added by elite01 on 03/02/09 01:05:05.
IPv6.patch (34.9 kB) - added by Wazar on 03/13/10 21:36:07.

Change History

08/12/08 10:03:25 changed by larsivi

  • owner changed from sean to kris.

08/20/08 11:43:19 changed by elite01

I started implementing some bits of IPv6 support, namely, and have a design question. The usual way to create an Address from a host name is new IPv4Address(""). This means that any application won't work with IPv6 without some code changes, which may break IPv4 compatibility. So, instead of directly creating IPv4Address or IPv6Address instances, there should be a factory method, possibly Address Address.get(char[] host) and variations. The issue is that you'd either need some registration mechanism for the address families, or have Address depend on IPv4Address, IPv6Address and others. I'd like to hear your opinion on that.

08/20/08 13:12:44 changed by Deewiant

Why not add a new module HostResolver?, or something, to move the dependency away from Address?

08/20/08 14:28:11 changed by elite01

I really like that suggestion. More opinions, anyone?

09/13/08 12:00:38 changed by elite01

Ok. Sorry for sleeping. I had to change quite a few things because I removed IPv4Address, moved all the functionality (IPv4 and IPv6) into InternetAddress and that class into, with nothing more than a public import in Of course, I am open for suggestions how to do this more cleanly, but I find this solution simple and functional.

I have attached a rather mighty patch for revision 3936. Please give it some testing. Much testing. Both for IPv4 and IPv6. I'm especially concerned about IPv4 applications breaking. Thanks!

09/24/08 08:51:53 changed by larsivi

Does this affect what is asked for in #1300 ?

09/25/08 02:51:36 changed by kris

  • status changed from new to assigned.

anyone done further testing on this? I've been swamped, with no time to get to it yet ...

09/26/08 16:01:30 changed by elite01

No, name and nameLen are still protected. Are there any reasons for not just making those public?

I superficially tested UDP on Linux, and it seems to work fine. Maybe I broke some broadcast or multicast functionality, or introduced unnecessary source incompatibilities. Name some complex application or library and I will test it.

I'll give Windows XP some love and implement the missing bits within the next week or so.

09/27/08 21:26:06 changed by kris

I suppose the only reason to suppress them is that the structure of that module may change over time, that's about all I can think of.

I'll test the XP stuff when it's ready :)

10/16/08 21:42:19 changed by larsivi

  • type changed from defect to enhancement.

elite01: Please see #1228

01/09/09 03:08:05 changed by mandel

There is a typo in the unitest of the patch: IneternetAddress?

03/02/09 01:05:05 changed by elite01

  • attachment socket.patch added.

11/09/09 04:51:09 changed by kris

elite01: did you get a chance to revise this since we last spoke?

11/13/09 23:33:29 changed by kris

  • cc set to elite01.

03/08/10 15:36:05 changed by Wazar

I've upload the patch, please test it and say, what is need else?

03/08/10 17:04:35 changed by kris

  • cc changed from elite01 to elite01, larsivi.

Thank you, we will

03/12/10 10:05:22 changed by Wazar

I've update the IPv6.patch. Now it works under 32 bit Linux. I hope it will be works under other 32 bit posix OS. Please test it under Windows and 64 bit posix.

03/12/10 18:01:01 changed by kris

thanks! Would you mind adding a little bit of documentation explaining what those new functions do? We're not sufficiently familiar with IPv6 to grok their usage right away :)

(follow-up: ↓ 19 ) 03/13/10 15:08:34 changed by Wazar

And some changes. Also added a few comments. What aspects need to be documented?

(in reply to: ↑ 18 ) 03/13/10 19:03:42 changed by kris

Replying to Wazar:

And some changes. Also added a few comments. What aspects need to be documented?

The new functions (mostly done already), and perhaps a little description (at the top) about how IPv6 differs in usage from IPv4? Nothing fancy ... perhaps a link to some online documentation if you know of a good explanation?


03/13/10 21:36:07 changed by Wazar

  • attachment IPv6.patch added.

03/13/10 21:37:30 changed by Wazar

I added comments at the top of IPv6Address class declaration.

03/14/10 19:13:30 changed by kris

will merge this during the week - thanks!

03/20/10 20:26:13 changed by kris

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [5409]) fixes #1239 :: IPv6 support

Big thanks to Wazar

05/10/10 07:00:40 changed by kris

  • cc changed from elite01, larsivi to wazar.
  • status changed from closed to reopened.
  • resolution deleted.

doesn't exist on Windows: gai_strerror(int errcode);

Can you find a resolution, please? :)