We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 283 - Patch for IPv6 support
Summary: Patch for IPv6 support
Status: ASSIGNED
Alias: None
Product: SDL_net
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86 Linux
: P2 enhancement
Assignee: Sam Lantinga
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-18 18:19 UTC by Alexandre Hamelin
Modified: 2015-07-22 19:24 UTC (History)
3 users (show)

See Also:


Attachments
IPv6 support for SDL_net (37.34 KB, patch)
2006-07-18 18:20 UTC, Alexandre Hamelin
Details | Diff
Updated ipv6 patch (36.84 KB, patch)
2011-07-02 12:33 UTC, Pinkbyte
Details | Diff
New version of ipv6 patch (36.74 KB, patch)
2011-07-09 02:53 UTC, Pinkbyte
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Hamelin 2006-07-18 18:19:26 UTC
I've adapted Simon Howard's IPv6 patch to be used on the latest code base of SDL_net, namely r2633 as of now. Please feel free to review the changes. His original patch is located on http://www.soulsphere.org/projects/ipv6/.

Be aware that, as describe on his page, the API changes a bit so some functions are rendered incompatible with the previous version of SDL_net.

Preliminary tests with a patched PrBoom for IPv6 are positive in that the server and the client can communicate. (I sent that patch to the PrBoom devel mailing list already.)
Comment 1 Alexandre Hamelin 2006-07-18 18:20:39 UTC
Created attachment 149 [details]
IPv6 support for SDL_net
Comment 2 Pinkbyte 2011-07-02 12:33:09 UTC
Created attachment 643 [details]
Updated ipv6 patch

This is updated version of ipv6 patch for sdl-net 1.2.7
Comment 3 Pinkbyte 2011-07-09 02:53:46 UTC
Created attachment 645 [details]
New version of ipv6 patch

This version does not broke backward compatibility with ipv6 tcp clients. Other thing are the same as in previous versions
Comment 4 Sam Lantinga 2012-01-02 22:10:58 UTC
I'll include this in the next major revision which can break API compatibility.
Thanks!
Comment 5 Sam Lantinga 2013-10-03 08:21:10 UTC
Comments from Robert Anderson:
My first glance at the source-code gave me these thoughts:

1. Cosmetic: Do not use code like
fprintf(stderr,
                                        "Cant resolve %s:%i\n",
                                        hostname, port);
Which would return output like 2001:2::1:2500 which is an illegal IPv6 address (which I can gruntingly understand)
but 2001:2::1:22 is ambiguous and I can't get if 22 is a port or part of the address.
Please use the style [2001:2::1]:22 which is not mentioned (or forbidden) in the RFC, but used in URI's
https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers
-------------------------------------
2. Stability: +int SDLNet_ResolveHost_new(SDLNet_AddrType type, IPaddress *address,
+                      const char *host, Uint16 port)

Since you can DNS resolve IPv6 addresses over IPv4; getting a DNS answer does not necessarily mean that you have IPv6-connectivity
(Sadly, most PC today have an IPv6-address and can resolve AAAA-records, but does *not* have IPv6-internet-connectivity
 [the developers of Minecraft still does not get this (:-(    ]     )

Both my windows PC and my Lubuntu laptop has an icon showing if you have (IPv6?) connectivity. This should be checked
before choosing to return the IPv4 or IPv6 address. (I think machine local check is better then doing an internet IPv6 connectivity test)

Thirdly you have the odd setup of a local LAN game, *including* a local DNS-server; all running native IPv6 (no IPv4) with no
internet IPv6-internet-connectivity. Then my suggestion would not work. (dual-stack would work, but it would always return the
fallback IPv4 address - even if IPv6 is preferred)
Local LAN games would work if IPv6 numerical addresses are use, no DNS lookups there (:-)

Summary: Don't return an IPv6 address if you don't have access to the IPv6-internet
Comment 6 Philipp Wiesemann 2015-07-22 19:24:35 UTC
Bug 2959 also has a patch for IPv6.