Re: bug in addrlist_match (with IPv6 addresses)

Christof Meerwald <[email protected]> Thu, 7 Aug 2003 17:39:31 +0200
Newsgroups gmane.network.xinetd
Message-ID <[email protected]>
On Wed, 6 Aug 2003 16:08:33 -0700 (PDT), Steve G wrote:
>> -  uint32_t *tmp_addr = (unsigned *)&addr->sa_data[3];
>> +  uint32_t *tmp_addr =
>> &SAIN6(addr)->sin6_addr.s6_addr32[3];
> I think I see what the problem is...missing parenthesis. It
> should have been: 
> 
> uint32_t *tmp_addr = ((unsigned *)&addr->sa_data)[3];
> 
> It was supposed to be the 3rd int (or 12 bytes) from the
> beginning of the structure.

But you are not allowed to assume that the IPv6 address is the first member
in the struct (and in fact this isn't the case with Linux).


bye, Christof

-- 
http://cmeerw.org                                 JID: [email protected]
mailto cmeerw at web.de