From: Simon Josefsson Date: Thu, 7 May 2009 12:17:07 +0000 (+0200) Subject: Fix build failure on systems without AF_INET6, e.g., Solaris 2.6. X-Git-Tag: gnutls_2_7_9~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d4d43611d08669b515513d76f7355334d767beeb;p=thirdparty%2Fgnutls.git Fix build failure on systems without AF_INET6, e.g., Solaris 2.6. Reported by "Tom G. Christensen" in . --- diff --git a/NEWS b/NEWS index ade2471134..25d0b28e91 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ Reported by Arfrever Frehtes Taifersar Arahesis in . +** Fix build failure on systems without AF_INET6, e.g., Solaris 2.6. +Reported by "Tom G. Christensen" in +. + ** doc: Fix tables of error codes and supported algorithms. ** API and ABI modifications: diff --git a/src/certtool-cfg.c b/src/certtool-cfg.c index 920dca94f9..679f04d9a6 100644 --- a/src/certtool-cfg.c +++ b/src/certtool-cfg.c @@ -795,6 +795,7 @@ string_to_ip (unsigned char *ip, const char *str) int len = strlen (str); int ret; +#if HAVE_IPV6 if (strchr (str, ':') != NULL || len > 16) { /* IPv6 */ ret = inet_pton (AF_INET6, str, ip); @@ -808,6 +809,7 @@ string_to_ip (unsigned char *ip, const char *str) return 16; } else +#endif { /* IPv4 */ ret = inet_pton (AF_INET, str, ip); if (ret <= 0) diff --git a/src/serv.c b/src/serv.c index 0679dee295..2e20979fb9 100644 --- a/src/serv.c +++ b/src/serv.c @@ -791,8 +791,10 @@ get_port (const struct sockaddr_storage *addr) { switch (addr->ss_family) { +#if HAVE_IPV6 case AF_INET6: return ntohs (((const struct sockaddr_in6 *) addr)->sin6_port); +#endif case AF_INET: return ntohs (((const struct sockaddr_in *) addr)->sin_port); }