Discussion:
SDL_net2 IPv6 support
(too old to reply)
powertomato
2013-09-22 22:42:44 UTC
Permalink
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/
Vittorio Giovara
2013-10-02 02:18:21 UTC
Permalink
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,
Vittorio
Post by powertomato
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Sam Lantinga
2013-10-03 08:22:03 UTC
Permalink
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 (:-( ] )

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
Post by powertomato
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Petr Pisar
2013-10-03 09:15:54 UTC
Permalink
Post by Sam Lantinga
There was a patch provided, but I don't know IPv6 well enough to know if it
https://bugzilla.libsdl.org/show_bug.cgi?id=283
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.)
Post by Sam Lantinga
-------------------------------------
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
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
T. Joseph Carter
2013-10-05 07:19:05 UTC
Permalink
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. :D

Joseph
Post by Sam Lantinga
There was a patch provided, but I don't know IPv6 well enough to know if it
https://bugzilla.libsdl.org/show_bug.cgi?id=283
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 (:-( ] )
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
Post by powertomato
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Sik the hedgehog
2013-10-05 18:45:10 UTC
Permalink
Post by 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.
T. Joseph Carter
2013-10-06 10:42:41 UTC
Permalink
Post by Sik the hedgehog
Post by 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. ;)

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. ;)

Joseph
Petr Pisar
2013-10-07 09:25:39 UTC
Permalink
Post by Sik the hedgehog
Post by 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
T. Joseph Carter
2013-10-07 09:48:24 UTC
Permalink
Post by Petr Pisar
Post by Sik the hedgehog
Post by 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>.
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.

Joseph
Sik the hedgehog
2013-10-08 03:51:25 UTC
Permalink
Post by Petr Pisar
Post by Sik the hedgehog
Post by 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?
Petr Pisar
2013-10-08 08:30:44 UTC
Permalink
Post by Sik the hedgehog
Post by Petr Pisar
Post by Sik the hedgehog
Post by 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.
Post by Sik the hedgehog
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

Loading...