On (10/29/08 12:02), Kacheong Poon wrote:
>
> Space may not be an issue here.  But if you are talking about
> using it generally, I guess it can be an issue in other cases.
> What convenience routines are you referring to?  For example,
> do you mean a routine to compare two socket addresses?  Then
> I guess that the routine will need to be do comparison on all
> the necessary fields.  But if a caller just uses sockaddr_storage
> to store an IP address and wants to use the aforementioned
> compare routine, then I guess it will need to do some unnecessary
> initialization to make it work.  Or is there a special family type
> to indicate IP address only in a sockaddr_storage?

The drawback of sockaddr_storage are that it has space for
things like sin_port in it, which may not be useful in all cases.
But most system call data (e.g., lifreq) are using sockaddr_storage,
so they are handy to pass around.

If we choose to have a general address storage structure, we
should make it shareable across all the libraries, instead of
reinventing this with each library.

--Sowmini

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to