]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix build failure on systems without AF_INET6, e.g., Solaris 2.6.
authorSimon Josefsson <simon@josefsson.org>
Thu, 7 May 2009 12:17:07 +0000 (14:17 +0200)
committerSimon Josefsson <simon@josefsson.org>
Thu, 7 May 2009 12:17:07 +0000 (14:17 +0200)
Reported by "Tom G. Christensen" <tgc@jupiterrise.com> in
<http://permalink.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/3524>.

NEWS
src/certtool-cfg.c
src/serv.c

diff --git a/NEWS b/NEWS
index ade24711347469d34f629bc788c927a2c8de8f4e..25d0b28e911276572738164d96b66f5eeeb0cb37 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,10 @@ Reported by Arfrever Frehtes Taifersar Arahesis
 <arfrever.fta@gmail.com> in
 <http://permalink.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/3522>.
 
+** Fix build failure on systems without AF_INET6, e.g., Solaris 2.6.
+Reported by "Tom G. Christensen" <tgc@jupiterrise.com> in
+<http://permalink.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/3524>.
+
 ** doc: Fix tables of error codes and supported algorithms.
 
 ** API and ABI modifications:
index 920dca94f904eee9dee2152823bff119baef9e21..679f04d9a6651c4f8aab8eed8de01e6efebb13c6 100644 (file)
@@ -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)
index 0679dee2953ab92e750829bf2e2524f576756685..2e20979fb9f292673ab776f858215a749110bb22 100644 (file)
@@ -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);
     }