1 |
pva 08/12/28 18:20:32 |
2 |
|
3 |
Added: geoip-1.4.5-ppc-fix.patch |
4 |
Log: |
5 |
Finally fixed test failure on ppc64 and marking it stable, bug #244256. Thank Brent Baude for hardware access. |
6 |
(Portage version: 2.2_rc17/cvs/Linux 2.6.26-openvz.git-89451f9 i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 dev-libs/geoip/files/geoip-1.4.5-ppc-fix.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/geoip/files/geoip-1.4.5-ppc-fix.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/geoip/files/geoip-1.4.5-ppc-fix.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: geoip-1.4.5-ppc-fix.patch |
15 |
=================================================================== |
16 |
Status of this patch: Reported upstream. |
17 |
|
18 |
The following assignment in libGeoIP/GeoIP.c is broken on ppc64: |
19 |
addr = *((unsigned long *) phe->h_addr_list[0]); |
20 |
|
21 |
phe->h_addr_list[0] on linux has type in_addr_t which is defined as: |
22 |
typedef uint32_t in_addr_t; |
23 |
|
24 |
On ppc64 sizeof(unsigned long) is 8 (!= 4, sizeof(uint32_t)). This code works |
25 |
on amd64 as it's little endian, while it became broken on big endian ppc64 |
26 |
systems. |
27 |
|
28 |
|
29 |
--- libGeoIP/GeoIP.c 2008-12-28 17:36:55 +0000 |
30 |
+++ libGeoIP/GeoIP.c 2008-12-28 17:37:41 +0000 |
31 |
@@ -811,8 +811,7 @@ |
32 |
buflength = buflength * 2; |
33 |
buf = realloc(buf,buflength); |
34 |
} |
35 |
-#endif |
36 |
-#ifndef HAVE_GETHOSTBYNAME_R |
37 |
+#else |
38 |
/* Some systems do not support gethostbyname_r, such as Mac OS X */ |
39 |
phe = gethostbyname(host); |
40 |
#endif |
41 |
@@ -820,7 +819,7 @@ |
42 |
free(buf); |
43 |
return 0; |
44 |
} |
45 |
- addr = *((unsigned long *) phe->h_addr_list[0]); |
46 |
+ addr = *((in_addr_t *) phe->h_addr_list[0]); |
47 |
} |
48 |
#ifdef HAVE_GETHOSTBYNAME_R |
49 |
free(buf); |