build-failure with no IPv6 available at runtime

Andreas Metzler ametzler at
Sun Dec 18 15:50:54 CET 2011

----- Forwarded message from Pino Toscano <pino at> -----
Message-ID: <20111218142339.18834.96560.reportbug at localhost.localdomain>

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


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.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: getaddrinfo_flags.diff
Type: text/x-diff
Size: 339 bytes
Desc: not available
URL: </pipermail/attachments/20111218/8a5e0815/attachment.diff>

More information about the Gnutls-devel mailing list