pidgin: 68383ecd: util: Bah, AF_INET6 probably isn't alway...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sun Apr 18 17:50:01 EDT 2010


-----------------------------------------------------------------
Revision: 68383ecd23cb8302b7e9036767d15f8fa23f8b04
Ancestor: a821cc098fc75ffd4bbb35f2403632fa7b29e214
Author: darkrain42 at pidgin.im
Date: 2010-04-16T03:44:18
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/68383ecd23cb8302b7e9036767d15f8fa23f8b04

Modified files:
        libpurple/util.c

ChangeLog: 

util: Bah, AF_INET6 probably isn't always available

-------------- next part --------------
============================================================
--- libpurple/util.c	93bcbf36374b2a3cac2fe7e0d745939b8a7f2b89
+++ libpurple/util.c	a16567f56409f472cb48ca40090a3a8721f157e0
@@ -2986,8 +2986,9 @@ purple_fd_get_ip(int fd)
 		struct sockaddr_in *ipv4 = (struct sockaddr_in *)&addr;
 		struct in_addr addr = ipv4->sin_addr;
 		return g_strdup(inet_ntoa(addr));
-	} else if (family == AF_INET6) {
-#ifdef HAVE_INET_NTOP
+	}
+#if defined(AF_INET6) && defined(HAVE_INET_NTOP)
+	else if (family == AF_INET6) {
 		struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&addr;
 		struct in6_addr addr = ipv6->sin6_addr;
 		char host[INET6_ADDRSTRLEN];
@@ -2995,11 +2996,8 @@ purple_fd_get_ip(int fd)
 
 		tmp = inet_ntop(family, &addr, host, sizeof(host));
 		return g_strdup(tmp);
-#else /* HAVE_INET_NTOP */
-		/* TODO: Patches welcome...I guess? */
-		return NULL;
+	}
 #endif
-	}
 
 	return NULL;
 }


More information about the Commits mailing list