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