Re: [PATCH 0/3] AF_INET6 support for probe_bothports()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Steinar H. Gunderson wrote:
> On Mon, Dec 08, 2008 at 08:46:36AM -0500, Steve Dickson wrote:
>> typedef struct {
>>     char **hostname;
>>     struct sockaddr_in saddr;
>>     struct pmap pmap; 
>> } clnt_addr_t;
>>
>> Why isn't saddr a struct sockaddr instead of a struct sockaddr_in?
>>
>> It seems at the beginning of each routine saddr is always being
>> typecast into a struct sockaddr pointer.... So wouldn't be easier
>> and cleaner to simply make sadd a struct sockaddr or am I missing
>> something?
> 
> I'm sure most people here know this, but still, be careful: If you ever
> intend to store an IPv6 address somewhere, the field in the struct should be
> a sockaddr_storage. sockaddr (or sockaddr_in, for that matter) is not big
> enough to store a sockaddr_in6.
Understood... But isn't a struct sockaddr large enough to store
a IPv6 address? Its no biggie... but what caught my eye was usually 
struct sockaddr are typecast into sockaddr_in, not the other away around.

steved.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux