equal
deleted
inserted
replaced
|
1 # date:2010-05-20 owner:hawklu type:bug d.o.o:16007 |
|
2 # |
|
3 # These changes should be submitted upstream. |
|
4 |
|
5 --- pidgin-2.7.0/libpurple/network.c.old 2010-05-19 16:14:46.440830715 +0800 |
|
6 +++ pidgin-2.7.0/libpurple/network.c 2010-05-19 16:38:25.005674810 +0800 |
|
7 @@ -57,6 +57,16 @@ |
|
8 #include <idna.h> |
|
9 #endif |
|
10 |
|
11 +/* Since OpenSolaris build 137, RFC2553 is supported |
|
12 + * so ifa_addr member of "struct ifaddrs" has type |
|
13 + * "struct sockaddr_storage" |
|
14 + */ |
|
15 +#ifdef HAVE_STRUCT_IFADDRS_IFA_ADDR__SS_FAMILY |
|
16 +#define ADDR_FAMILY_MEMBER ss_family |
|
17 +#else |
|
18 +#define ADDR_FAMILY_MEMBER sa_family |
|
19 +#endif |
|
20 + |
|
21 /* |
|
22 * Calling sizeof(struct ifreq) isn't always correct on |
|
23 * Mac OS X (and maybe others). |
|
24 @@ -219,7 +229,7 @@ |
|
25 } |
|
26 |
|
27 for (ifa = start; ifa; ifa = ifa->ifa_next) { |
|
28 - int family = ifa->ifa_addr ? ifa->ifa_addr->sa_family : AF_UNSPEC; |
|
29 + int family = ifa->ifa_addr ? ifa->ifa_addr->ADDR_FAMILY_MEMBER: AF_UNSPEC; |
|
30 char host[INET6_ADDRSTRLEN]; |
|
31 const char *tmp = NULL; |
|
32 |
|
33 @@ -265,7 +275,7 @@ |
|
34 ifr = (struct ifreq *)tmp; |
|
35 tmp += HX_SIZE_OF_IFREQ(*ifr); |
|
36 |
|
37 - if (ifr->ifr_addr.sa_family == AF_INET) { |
|
38 + if (ifr->ifr_addr.ADDR_FAMILY_MEMBER == AF_INET) { |
|
39 struct sockaddr_in *sinptr = (struct sockaddr_in *)&ifr->ifr_addr; |
|
40 |
|
41 inet_ntop(AF_INET, &sinptr->sin_addr, dst, |