apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Pryor <ppryo...@gmail.com>
Subject AIX 5.3 sockaddr.c patch
Date Fri, 19 Jun 2009 18:18:24 GMT
I found the problem with IN6_IS_ADDR_V4MAPPED macro on AIX which
caused it to bomb in testsock. The patch below should fix it.

$ diff network_io/unix/sockaddr.c.orig network_io/unix/sockaddr.c
70a71,79
> /* work around broken AIX implementation */
> #ifdef _AIX
> #undef IN6_IS_ADDR_V4MAPPED
> #define IN6_IS_ADDR_V4MAPPED(a) \
>         ((((a)->s6_addr32)[0] == 0) && \
>          (((a)->s6_addr32)[1] == 0) && \
>          (((a)->s6_addr32)[2] == 0x0000ffff))
> #endif

The reason it bombed is that on AIX the macro IN6_IS_ADDR_V4MAPPED
expands to IS_IPV4ADDR6 (shown below) which tests last 4 bytes to see
if it is not zero. We only want to know if IPV4 is mapped into IPV6,
and we dont care what IPV4 is. Hence the last test in the macro should
not matter.

#define IS_IPV4ADDR6(a) \
        (((a).s6_addr32[0] == 0) && \
         ((a).s6_addr32[1] == 0) && \
         ((a).s6_addr32[2] == 0x0000ffff) && \
         ((a).s6_addr32[3] != 0))

Here is test result on AIX 5.3:

APR Lock Performance Test
==============
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (UNNESTED)          OK
    Starting 1 threads    OK
microseconds: 449099 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (NESTED)            OK
    Starting 1 threads    OK
microseconds: 598798 usec
apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 1 threads    OK
microseconds: 1390693 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (UNNESTED)          OK
    Starting 2 threads    OK
microseconds: 1599206 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (NESTED)            OK
    Starting 2 threads    OK
microseconds: 2049028 usec
apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 2 threads    OK
microseconds: 2823894 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (UNNESTED)          OK
    Starting 3 threads    OK
microseconds: 1662840 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (NESTED)            OK
    Starting 3 threads    OK
microseconds: 1350141 usec
apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 3 threads    OK
microseconds: 2000922 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (UNNESTED)          OK
    Starting 4 threads    OK
microseconds: 1765885 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (NESTED)            OK
    Starting 4 threads    OK
microseconds: 1857919 usec
apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 4 threads    OK
microseconds: 2850588 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (UNNESTED)          OK
    Starting 5 threads    OK
microseconds: 2216577 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (NESTED)            OK
    Starting 5 threads    OK
microseconds: 2237820 usec
apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 5 threads    OK
microseconds: 3311527 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (UNNESTED)          OK
    Starting 6 threads    OK
microseconds: 2825558 usec
apr_thread_mutex_t Tests
    Initializing the apr_thread_mutex_t (NESTED)            OK
    Starting 6 threads    OK
microseconds: 2712670 usec
apr_thread_rwlock_t Tests
    Initializing the apr_thread_rwlock_t                    OK
    Starting 6 threads    OK
microseconds: 3977302 usec
Trying proc mutexes with mechanism `default'...
  Mutex mechanism `default' is global in scope on this platform.
Trying global mutexes with mechanism `default'...
  no problems encountered...
Trying proc mutexes with mechanism `sysvsem'...
  Mutex mechanism `sysvsem' is global in scope on this platform.
Trying global mutexes with mechanism `sysvsem'...
  no problems encountered...
Trying proc mutexes with mechanism `posix'...
  Mutex mechanism `posix' is global in scope on this platform.
Trying global mutexes with mechanism `posix'...
  no problems encountered...
Trying proc mutexes with mechanism `fcntl'...
  Mutex mechanism `fcntl' is not global in scope on this platform.
Trying global mutexes with mechanism `fcntl'...
  no problems encountered...
Trying proc mutexes with mechanism `proc_pthread'...
  Mutex mechanism `proc_pthread' is global in scope on this platform.
Trying global mutexes with mechanism `proc_pthread'...
  no problems encountered...
testatomic          : SUCCESS
testdir             : SUCCESS
testdso             : SUCCESS
testdup             : SUCCESS
testenv             : SUCCESS
testfile            : SUCCESS
testfilecopy        : SUCCESS
testfileinfo        : SUCCESS
testflock           : SUCCESS
testfmt             : SUCCESS
testfnmatch         : SUCCESS
testargs            : SUCCESS
testhash            : SUCCESS
testipsub           : SUCCESS
testlock            : SUCCESS
testcond            : SUCCESS
testlfs             : SUCCESS
testmmap            : SUCCESS
testnames           : SUCCESS
testoc              : SUCCESS
testpath            : SUCCESS
testpipe            : SUCCESS
testpoll            : SUCCESS
testpools           : SUCCESS
testproc            : SUCCESS
testprocmutex       : SUCCESS
testrand            : SUCCESS
testsleep           : SUCCESS
testshm             : SUCCESS
testsock            : SUCCESS
testsockets         : SUCCESS
testsockopt         : SUCCESS
teststr             : SUCCESS
teststrnatcmp       : SUCCESS
testtable           : SUCCESS
testtemp            : SUCCESS
testthread          : SUCCESS
testtime            : SUCCESS
testud              : SUCCESS
testuser            : SUCCESS
testvsn             : SUCCESS
All tests passed.

Mime
View raw message