lists.arthurdejong.org
RSS feed

Re: cvsd commit: MODIFIED: . ...

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: cvsd commit: MODIFIED: . ...



On Wed, 2010-08-25 at 23:24 +0200, Commits of the cvsd project wrote:
> now always ignore EADDRINUSE for bind() calls because now IPv4
> addresses from getaddrinfo() are returned before IPv6 ones for some
> reason

It seems that getaddrinfo() was changed in Glibc somewhere between 2.7
and 2.11 causing a problem for cvsd if the net.ipv6.bindv6only sysctl is
set to 0.

When doing getaddrinfo(NULL,svn) IPv6 addresses were always returned
before IPv4 addresses, now it is the other way around. cvsd assumes IPv6
addresses are returned first and ignores errors when binding on an IPv4
address if the previous attempt to bind an IPv6 address succeeded. Since
the order has changed this test no longer works.

This problem has been fixed in cvsd and will be in the next release. The
fix is available here:
  http://arthurdejong.org/viewvc/cvsd/cvsd.c?r1=1.117&r2=1.119

A workaround for earlier versions is to specify the following in
cvsd.conf which will disable IPv6 for cvsd:
  Listen 0.0.0.0 2401

Another solution is to ensure that the net.ipv6.bindv6only sysctl is set
to 1.


Note that the fix will not bring back IPv6 support if
net.ipv6.bindv6only is set to 0 because the order of the addresses
returned by getaddrinfo() causes problems. If the IPv4 port is bound
first you cannot later also bind the IPv6 port.

If you need to have net.ipv6.bindv6only set to 0 and want IPv6 cvsd you
need to add this to cvsd.conf (this will also provide IPv4 but not if
net.ipv6.bindv6only is set to 1):
  Listen :: 2401

With ipv6.bindv6only set to 1 everything works fine because the IPv4 and
IPv6 stacks are completely separate. I believe this is the more correct
behaviour (used by the BSDs since the beginning) but has been known to
cause problems for some applications that make wrong assumptions (most
notably Java).



Anyway, the original bug report that triggered this is here:
  https://bugs.launchpad.net/bugs/622035


ps. the list of files that need to be parsed to do a simple
    getaddrinfo() call on Linux now seem to be: /etc/nsswitch.conf, 
    /etc/host.conf, /etc/resolv.conf, /etc/gai.conf (all specifying
    the order of items to be returned in their own way)

-- 
-- arthur - arthur@arthurdejong.org - http://arthurdejong.org --
--
To unsubscribe send an email to
cvsd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/cvsd-users