5089N/A# date:2010-05-20 owner:hawklu type:bug d.o.o:16007
5089N/A#
5089N/A# These changes should be submitted upstream.
5089N/A
5089N/A--- pidgin-2.7.0/libpurple/network.c.old 2010-05-19 16:14:46.440830715 +0800
5089N/A+++ pidgin-2.7.0/libpurple/network.c 2010-05-19 16:38:25.005674810 +0800
5089N/A@@ -57,6 +57,16 @@
5089N/A #include <idna.h>
5089N/A #endif
5089N/A
5089N/A+/* Since OpenSolaris build 137, RFC2553 is supported
5089N/A+ * so ifa_addr member of "struct ifaddrs" has type
5089N/A+ * "struct sockaddr_storage"
5089N/A+ */
5089N/A+#ifdef HAVE_STRUCT_IFADDRS_IFA_ADDR__SS_FAMILY
5089N/A+#define ADDR_FAMILY_MEMBER ss_family
5089N/A+#else
5089N/A+#define ADDR_FAMILY_MEMBER sa_family
5089N/A+#endif
5089N/A+
5089N/A /*
5089N/A * Calling sizeof(struct ifreq) isn't always correct on
5089N/A * Mac OS X (and maybe others).
5089N/A@@ -219,7 +229,7 @@
5089N/A }
5089N/A
5089N/A for (ifa = start; ifa; ifa = ifa->ifa_next) {
5089N/A- int family = ifa->ifa_addr ? ifa->ifa_addr->sa_family : AF_UNSPEC;
5089N/A+ int family = ifa->ifa_addr ? ifa->ifa_addr->ADDR_FAMILY_MEMBER: AF_UNSPEC;
5089N/A char host[INET6_ADDRSTRLEN];
5089N/A const char *tmp = NULL;
5089N/A
5089N/A@@ -265,7 +275,7 @@
5089N/A ifr = (struct ifreq *)tmp;
5089N/A tmp += HX_SIZE_OF_IFREQ(*ifr);
5089N/A
5089N/A- if (ifr->ifr_addr.sa_family == AF_INET) {
5089N/A+ if (ifr->ifr_addr.ADDR_FAMILY_MEMBER == AF_INET) {
5089N/A struct sockaddr_in *sinptr = (struct sockaddr_in *)&ifr->ifr_addr;
5089N/A
5089N/A inet_ntop(AF_INET, &sinptr->sin_addr, dst,