[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Adding ipv6 support.



On 2011-02-07 14:09, William Ahern wrote:
>> Furthermore, you're ignoring alignment issues.
> 
> There are no alignment issues here, arguably not even if we're talking pure
> standard C. Certainly not in any implementation that supports the BSD
> sockets API and the .sa_family member overlay.

It should be 64-bit aligned (see RFC 3493).

Just add the appropriate compiler-specific magic, or simply use
sockaddr_storage.

>> The best current practice is to use sockaddr_storage. See e.g.
>> http://www.kame.net/newsletter/19980604/ for more info.
> 
> That page is very BSD centric. For example, SysV derivatives like Solaris
> and Linux don't have .sa_len.

The advice it contains applies everywhere. Application code should not
make use of _len members.

Simon
-- 
DTN made easy, lean, and smart --> http://postellation.viagenie.ca
NAT64/DNS64 open-source        --> http://ecdysis.viagenie.ca
STUN/TURN server               --> http://numb.viagenie.ca
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.