On Sat, Nov 22, 2014 at 01:04:58PM +0200, Vlad Khorsun wrote:
> 21.11.2014 16:45, Michal Kubecek wrote:
> > On Fri, Nov 21, 2014 at 02:01:09PM +0200, Vlad Khorsun wrote:
> >> 21.11.2014 13:11, Michal Kubecek wrote:
> >>>
> >>> That's unfortunate... I suppose the easiest way out of this would be
> >>> adding something like
> >>>
> >>> #ifdef WIN_NT
> >>>   if (!host_str && /* Windows version < Vista */)
> >>>           gai_hints.ai_family = AF_INET;
> >>> #endif
> >>>
> >>> This should also take care of XP/2003 with IPv6 support (making the
> >>> server listen on 0.0.0.0 by default).
> >>
> >>     I can commit function which checks if IPv6 support is present (it will
> >> be based on WSAEnumProtocols). Can it help ?
> >
> > That would help to handle the case of IPv6 not supported.
> 
>    Done. See os_utils::isIPv6supported().

Thank you. I checked that 'RemoteBindAddress 0.0.0.0' already works on
XP with current daily snapshot (build 31441) so with your commit default
XP without IPv6 support should work even without the workaround.

>   Note, POSIX implementation just returns true. It could be changed to
>   look for '/proc/net/if_inet6', for example, but i not sure it is
>   necessary, as Linux kernels since v2.4 already have support for IPv6

IPv6 can still be disabled in few different ways, e.g.

  - kernel built with CONFIG_IPV6 disabled
  - IPv6 built as module and the module is not loaded (blacklisted)
  - kernel booted with ipv6.disable=1 parameter
  - IPv6 disabled in /proc/sys/net/ipv6/conf/*/disable_ipv6 (can be done
    even per interface)

I checked last three and current code handles them without issues.
Completely disabled IPv6 in kernel configuration should be extremely
rare today and I wouldn't expect it in any standard distribution kernel.

> Have no idea if and how it should be implemented in other *nixes
> (Darwin, etc)...

In general, trying

    socket(PF_INET6, SOCK_STREAM, 0);

should be reliable way to check if there is support of IPv6 as such (it
probably wouldn't catch things like disabling IPv6 via sysctl on Linux).

Anyway, I would suggest to leave it as is for now until we know if there
are any posix systems having problems and how exactly they behave.

                                                          Michal Kubecek


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to