While we know that "struct sockaddr_storage" has been engineered to alias
to all the sockaddr structs, the compiler does not know about this.
Thus, code like this may be unsafe to use:
struct sockaddr_storage ss;
struct sockaddr_in *sin = &ss;
sin->sin_port = 0; /* dereferencing here breaks ISO C aliasing rules */
A workaround is to wrap the struct in a union, e.g:
union anonymous {
struct sockaddr_storage ss;
struct sockaddr_in sin;
} u;
u.sin.sin_port = 0;
--
Approved by: joerg