n Fri, Jun 19, 2009 at 1:18 PM, Paul Pryor <ppryo...@gmail.com> wrote:
> 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))


I'm hesistant to replace the macro, but could we avoid INADDR_ANY in
testsock?  The test already seems to rely on 127.0.0.1 and this also
makes the test pass.

-- 
Eric Covener
cove...@gmail.com

Reply via email to