Bug#652552: gnutls28: FTBFS with no IPv6 available at runtime

Pino Toscano pino at debian.org
Sun Dec 18 14:23:39 UTC 2011


Package: gnutls28
Version: 3.0.9-2
Severity: important
Tags: patch

Hi,

if the current kernel (be it Linux compiled without it, or Hurd with no
inet6 translator setup) does not provide support for IPv6, two tests,
- dsa/testdsa
- openpgp-certs/testcerts
will fail. This is because gnutls-serv queries (in src/serv.c,
listen_socket()) getaddrinfo() to known all the available addresses
for the specified port, returning even those which cannot be configured
(and for which socket() will fail with EAFNOSUPPORT). At least on Hurd,
the returned list from getaddrinfo() had two elements, first the AF_INET
and then AF_INET6, and given that the return value of the last execution
of socket() returns -1, that is the return value of the whole
listen_socket(), even if the AF_INET socket has been correctly setup.

My solution is adding the AI_ADDRCONFIG flag to the hints for
getaddrinfo(), so it returns only addresses which can be configured.
(See also [1].) This should allow gnutls-serv to listen to both IPv4
and IPv6 if both are available in the system, or just IPv4 if IPv6
cannot be used.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html

Thanks,
-- 
Pino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getaddrinfo_flags.diff
Type: text/x-diff
Size: 339 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnutls-maint/attachments/20111218/07084617/attachment.diff>


More information about the Pkg-gnutls-maint mailing list