GnuTLS 2.6.6/2.7.8 assumes AF_INET6 is available

Simon Josefsson simon at
Wed May 6 10:01:20 CEST 2009

"Tom G. Christensen" <tgc at> writes:

>> Interesting.  Does adding this to the top of serv.c work:
>> #ifndef HAVE_IPV6
>> # define sockaddr_storage sockaddr_in
>> #endif
> This causes another error:
> gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -I../includes -I../includes
> -I../lgl -I../lgl -I../gl -I../gl -I./cfg -I/usr/tgcware/include
> -I/usr/tgcware/include -g -O2 -Wno-pointer-sign -MT serv.o -MD -MP -MF
> .deps/serv.Tpo -c -o serv.o serv.c
> serv.c: In function 'get_port':
> serv.c:789: error: 'const struct sockaddr_in' has no member named
> 'ss_family'
> make[3]: *** [serv.o] Error 1

Oops, try this instead:

#ifndef HAVE_IPV6
# define sockaddr_storage sockaddr

There is another more complex work around mentioned at the end of:

Maybe the above won't work, and then maybe we need something like that.


More information about the Gnutls-devel mailing list