SDL_net2 IPv6 support

Hi,

I’m not sure if this belongs here, if not I apologize for it.

I picked somewhere up (can’t find it anymore) that the next major
version of SDL_net would support IPv6. I know that an ancient patch
exsists [1, 2] which isn’t official.

As I see there’s no API change regarding this. Since the jump from
SDL1.2 to SDL2.0 introduced API changes I hoped SDL_net would do the
same and enable IPv6 support. Sadly this doesn’t seem to be the case.

Does anyone know the status on this? Are there even (official) plans on
IPv6 support?

Best regards,
-powertomato–
[1] https://soulsphere.org/hacks/ipv6/newapi.html
[2] https://soulsphere.org/hacks/ipv6/

I don’t think anything has changed on that front.
I’d recommend you open a bug in bugzilla, maybe attaching the old patch, so
that this does not get forgotten again.

Cheers,
VittorioOn Monday, September 23, 2013, powertomato wrote:

Hi,

I’m not sure if this belongs here, if not I apologize for it.

I picked somewhere up (can’t find it anymore) that the next major
version of SDL_net would support IPv6. I know that an ancient patch
exsists [1, 2] which isn’t official.

As I see there’s no API change regarding this. Since the jump from
SDL1.2 to SDL2.0 introduced API changes I hoped SDL_net would do the
same and enable IPv6 support. Sadly this doesn’t seem to be the case.

Does anyone know the status on this? Are there even (official) plans on
IPv6 support?

Best regards,
-powertomato


[1] https://soulsphere.org/hacks/ipv6/newapi.html
[2] https://soulsphere.org/hacks/ipv6/


SDL mailing list
SDL at lists.libsdl.org <javascript:;>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

There was a patch provided, but I don’t know IPv6 well enough to know if it
was correct or complete, and had no way of testing it:
https://bugzilla.libsdl.org/show_bug.cgi?id=283

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’shttps://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 (:frowning: ] )

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 (:slight_smile:

Summary: Don’t return an IPv6 address if you don’t have access to the
IPv6-internet

On Sun, Sep 22, 2013 at 3:42 PM, powertomato wrote:

Hi,

I’m not sure if this belongs here, if not I apologize for it.

I picked somewhere up (can’t find it anymore) that the next major
version of SDL_net would support IPv6. I know that an ancient patch
exsists [1, 2] which isn’t official.

As I see there’s no API change regarding this. Since the jump from
SDL1.2 to SDL2.0 introduced API changes I hoped SDL_net would do the
same and enable IPv6 support. Sadly this doesn’t seem to be the case.

Does anyone know the status on this? Are there even (official) plans on
IPv6 support?

Best regards,
-powertomato


[1] https://soulsphere.org/hacks/ipv6/newapi.html
[2] https://soulsphere.org/hacks/ipv6/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

There was a patch provided, but I don’t know IPv6 well enough to know if it
was correct or complete, and had no way of testing it:
https://bugzilla.libsdl.org/show_bug.cgi?id=283

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’shttps://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers

RFC 3986 describes the bracket syntax. (Moreover one can use getnameinfo() to
format a socket address properly.)


  1. 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 (:frowning: ] )

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 (:slight_smile:

Summary: Don’t return an IPv6 address if you don’t have access to the
IPv6-internet

I did not studied what the function does, but in network family agnostic code,
you cannot return one socket address for one symbolic (domain) name. You have
to return list of addresses. The list is automatically sorted according to
system prefereneces (RFC 6724) by system resolver.

– Petr
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20131003/89fbcf5f/attachment-0001.pgpOn Thu, Oct 03, 2013 at 01:22:03AM -0700, Sam Lantinga wrote:

I guess my concern with IPv6 is that it necessarily calls for API and
ABI changes. That’s somewhat annoying for a library in production
use since, at least for a time, there’s at least the potential that
one of those things might change.

I’m not sure that can be helped, but I’d suggest mitigating efforts:

  • Implement IPv6-readiness now and consider anything reported as
    breaking under IPv6 (such as x.x.x.x:y vs. the IPv6-ready [x.x.x.x]:y
    for example) to be a bug. I think this is somewhat complicated
    because x.x.x.x:y is expected to keep working on IPv4 addresses, with
    or without brackets? Certainly it’s expected to work with URLs.

  • Put IPv6 support under a conditional for the time being. Encourage
    testing, but with the big warning sticker that ABI and potentially
    API instability may exist until it’s agreeably working.

  • When the list hears back that SDL_net is basically working properly
    on IPv6 in widespread-enough places that one can reasonably determine
    it’s going to work and need not be mucked about at the API level,
    remove the warning sticker and the experimental conditional (do all
    of SDL’s supported platforms at this point have the ability to build
    for IPv6?)

http://grothoff.org/christian/rmv608.pdf cleared up a couple of
things for me, and presumably if I was there for the talk that goes
along with the slides I might even understand it. :smiley:

JosephOn Thu, Oct 03, 2013 at 01:22:03AM -0700, Sam Lantinga wrote:

There was a patch provided, but I don’t know IPv6 well enough to know if it
was correct or complete, and had no way of testing it:
https://bugzilla.libsdl.org/show_bug.cgi?id=283

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’shttps://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers

  1. 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 (:frowning: ] )

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 (:slight_smile:

Summary: Don’t return an IPv6 address if you don’t have access to the
IPv6-internet

On Sun, Sep 22, 2013 at 3:42 PM, powertomato wrote:

Hi,

I’m not sure if this belongs here, if not I apologize for it.

I picked somewhere up (can’t find it anymore) that the next major
version of SDL_net would support IPv6. I know that an ancient patch
exsists [1, 2] which isn’t official.

As I see there’s no API change regarding this. Since the jump from
SDL1.2 to SDL2.0 introduced API changes I hoped SDL_net would do the
same and enable IPv6 support. Sadly this doesn’t seem to be the case.

Does anyone know the status on this? Are there even (official) plans on
IPv6 support?

Best regards,
-powertomato


[1] https://soulsphere.org/hacks/ipv6/newapi.html
[2] https://soulsphere.org/hacks/ipv6/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

2013/10/5, T. Joseph Carter :

  • Implement IPv6-readiness now and consider anything reported as
    breaking under IPv6 (such as x.x.x.x:y vs. the IPv6-ready [x.x.x.x]:y
    for example) to be a bug. I think this is somewhat complicated
    because x.x.x.x:y is expected to keep working on IPv4 addresses, with
    or without brackets? Certainly it’s expected to work with URLs.

IPv4 addresses always have dots (you can’t omit parameters) while IPv6
never have them, I’d imagine that could be used to tell apart an IPv6
address from an IPv4 one for starters.

I was under the impression that on an IPv6-only system (who does
that?) one can still use an IPv4-formatted address by simply using it
like so:

0:0:0:0:0:ffff:10.0.0.20

Or more sanely:

::ffff:10.0.0.20

?though why an IPv6-only system would be trying to reach 10.0.0.20
and not fc00::14 is beyond me. :wink:

That said, an IPv6 address will never contain at most one ':'
followed by a series of decimal digits representing a Uint16 like
that. DNS names and IPv4 addresses might. But an IPv6 address
followed by :port will always wrap the IPv6 address in brackets. I
understand the syntax [10.0.0.20]:8080 is becoming acceptable for
IPv4, but it’s not required. And I’ve never heard of dotted quad
notation in IPv6 addresses being acceptable except when preceded by
some variant of “::ffff:” (though whether that’s by convention or by
API mandate I don’t know?)

I know I’ve seen the mixed-mode IPv6 addresses, though. I had to
parse them in a script that needed the IPv4 address I was logging in
from to update dynamic DNS. :wink:

JosephOn Sat, Oct 05, 2013 at 03:45:10PM -0300, Sik the hedgehog wrote:

2013/10/5, T. Joseph Carter <@T_Joseph_Carter>:

  • Implement IPv6-readiness now and consider anything reported as
    breaking under IPv6 (such as x.x.x.x:y vs. the IPv6-ready [x.x.x.x]:y
    for example) to be a bug. I think this is somewhat complicated
    because x.x.x.x:y is expected to keep working on IPv4 addresses, with
    or without brackets? Certainly it’s expected to work with URLs.

IPv4 addresses always have dots (you can’t omit parameters) while IPv6
never have them, I’d imagine that could be used to tell apart an IPv6
address from an IPv4 one for starters.

No. There is variety of ways how to denote IPv4 address. Actually more than in
case of IPv6. http://en.wikipedia.org/wiki/IPv4#Address_representations.

– Petr
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20131007/4a469b75/attachment.pgpOn Sat, Oct 05, 2013 at 03:45:10PM -0300, Sik the hedgehog wrote:

2013/10/5, T. Joseph Carter :

  • Implement IPv6-readiness now and consider anything reported as
    breaking under IPv6 (such as x.x.x.x:y vs. the IPv6-ready [x.x.x.x]:y
    for example) to be a bug. I think this is somewhat complicated
    because x.x.x.x:y is expected to keep working on IPv4 addresses, with
    or without brackets? Certainly it’s expected to work with URLs.

IPv4 addresses always have dots (you can’t omit parameters)

Not only does that work, but I managed to mix octal, decimal, and hex
in the same dotted quad and apps like ping do the right thing.

However ping [127.0.0.1] says invalid address.

JosephOn Mon, Oct 07, 2013 at 11:25:39AM +0200, Petr Pisar wrote:

On Sat, Oct 05, 2013 at 03:45:10PM -0300, Sik the hedgehog wrote:

2013/10/5, T. Joseph Carter <@T_Joseph_Carter>:

  • Implement IPv6-readiness now and consider anything reported as
    breaking under IPv6 (such as x.x.x.x:y vs. the IPv6-ready [x.x.x.x]:y
    for example) to be a bug. I think this is somewhat complicated
    because x.x.x.x:y is expected to keep working on IPv4 addresses, with
    or without brackets? Certainly it’s expected to work with URLs.

IPv4 addresses always have dots (you can’t omit parameters)

No. There is variety of ways how to denote IPv4 address. Actually more than in
case of IPv6. http://en.wikipedia.org/wiki/IPv4#Address_representations.

2013/10/7, Petr Pisar :> On Sat, Oct 05, 2013 at 03:45:10PM -0300, Sik the hedgehog wrote:

2013/10/5, T. Joseph Carter :

  • Implement IPv6-readiness now and consider anything reported as
    breaking under IPv6 (such as x.x.x.x:y vs. the IPv6-ready [x.x.x.x]:y
    for example) to be a bug. I think this is somewhat complicated
    because x.x.x.x:y is expected to keep working on IPv4 addresses, with
    or without brackets? Certainly it’s expected to work with URLs.

IPv4 addresses always have dots (you can’t omit parameters)

No. There is variety of ways how to denote IPv4 address. Actually more than
in
case of IPv6. http://en.wikipedia.org/wiki/IPv4#Address_representations.

– Petr

You still aren’t going to get an IPv6 address where there’s a dot
before the first colon.

Undotted addresses may be an issue though, since they could clash
with some special URLs (most well known URL that’s undotted one
probably is “localhost”, but that one has non-hex characters). Any
ideas? Is there a minimum amount of colons an IPv6 address must have?

2013/10/7, Petr Pisar <@Petr_Pisar>:

2013/10/5, T. Joseph Carter :

  • Implement IPv6-readiness now and consider anything reported as
    breaking under IPv6 (such as x.x.x.x:y vs. the IPv6-ready [x.x.x.x]:y
    for example) to be a bug. I think this is somewhat complicated
    because x.x.x.x:y is expected to keep working on IPv4 addresses, with
    or without brackets? Certainly it’s expected to work with URLs.

IPv4 addresses always have dots (you can’t omit parameters)

No. There is variety of ways how to denote IPv4 address. Actually more than
in
case of IPv6. http://en.wikipedia.org/wiki/IPv4#Address_representations.

– Petr

You still aren’t going to get an IPv6 address where there’s a dot
before the first colon.

I talked about IPv4 only.

Undotted addresses may be an issue though, since they could clash
with some special URLs (most well known URL that’s undotted one
probably is “localhost”, but that one has non-hex characters). Any
ideas? Is there a minimum amount of colons an IPv6 address must have?

Please do not invent your own parsers. Use system-provided getaddrinfo(3) to
resolve domain name or to valide a network address.

Getting domain name from URL is straightforward. Anything between first colon
and next colon or a slash is a domain, if there is no bracket after the first
colon. Otherwise use closing bracket to locate the end of the domain.

– Petr
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20131008/47a4b233/attachment.pgpOn Tue, Oct 08, 2013 at 12:51:25AM -0300, Sik the hedgehog wrote:

On Sat, Oct 05, 2013 at 03:45:10PM -0300, Sik the hedgehog wrote: