In article <[EMAIL PROTECTED]> (at Fri, 09 Feb 2007 12:31:23 +0000), David
Howells <[EMAIL PROTECTED]> says:
> YOSHIFUJI Hideaki <[EMAIL PROTECTED]> wrote:
>
> > and make it sure to align on 64-bit word.
>
> The first part of sockaddr_rxrpc is exactly 64 bits; then comes the transport
> address, so that's okay.
>
> > This sockaddr_rxrpc{} should NOT include sockaddr_in{} directly.
> > Please use sockaddr_storage{} (or sockaddr{}, maybe),
>
> Why can't I include sockaddr_in and sockaddr_in6 in sockaddr_rxrpc, btw?
Because it is protocol (such as ipv4 or ipv6) dependent.
You cannot use different sturcture for one address family.
You could use union, maybe.
> > > That won't work. That would then make the address larger than the maximum
> > > size (ie: sizeof(struct sockaddr_storage)).
> >
> > sockaddr{}, then...
>
> But that's not big enough to hold a sockaddr_in6...
struct sockaddr_rxrpc {
...
union {
struct sockaddr rxrpc_sa;
struct sockaddr_in rxrpc_sin;
struct sockaddr_in6 rxrpc_sin6;
} __attribute__((__aligned(8)__));
};
Another option would be to introduce new transport protocol such as
dccp or sctp, no?
--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html