Re: [PATCH] Add IPv6 support for remote TCP connections

Paul Fertser
2014-02-09T09:53:19Z

Hi,

On Sun, Feb 09, 2014 at 09:30:56AM +0100, Jan Kratochvil wrote:
> and currently a different patch is on
> jankratochvil/ipv6
> git://sourceware.org/git/archer.git
>
> It should also implement IPv6 in gdbserver (which you may not need).

That was my other concern indeed. I am afraid your implementation
relies on IPv4-mapped IPv6 which is not supported on OpenBSD at all
(and also on older windows versions including wxp and w2k3) and can be
disabled by system administrators on other systems.

I think the way I modified net_open() behaviour matches the current
code closer, i.e. in case the target didn't bind its socket yet in my
version it'll will cycle through all the available addresses for 15
seconds and it looks like in your version it'll try connecting once to
all potential addresses, get "connection refused" and give up.

> The problem is that MinGW (=MS-Windows) port does not have getaddrinfo, there
> are multiple way how to deal with it, the most clean should be via extending
> gdb/gnulib/ :

Do you take into account that there're currently two competing
solutions for providing windows support: MinGW and MinGW-w64? The
former declares tools availability as their aim, but the latter also
strives for C99 and some POSIX compatibility. There's also Cygwin
which is, of course, even closer to traditional systems. All major
distros (that provide cross-compiling toolchain for windows) switched
to MinGW-w64 by now.

I've just tried cross-compiling code with getaddrinfo with mingw-w64
without any replacements and it was built (and run with wine) just
fine.

> But then mingw build fails. I tried to fix it in archer/jankratochvil/ipv6
> ( git://sourceware.org/git/archer.git ) but I got lost in what is the right way
> so I guess you should do it from scratch on your own. I tried it more
> a quick&dirty way but it probably needs a more clean thorough rework IMO.

https://www.gnu.org/software/gnulib/manual/html_node/getaddrinfo.html
implies all compatibility issues should be solved with it. So is it
not so, and there's a bug in gnulib?

> So due to buggy MinGW normal OSes still can't use IPv6 after 7 years while IPv4
> even no longer exists on some networks.

Probably it's time to change that finally, especially given MinGW-w64
seems to work fine?

--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com