From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: jeff.zheng@intel.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Why size of sockaddr smaller than size of sockaddr_in6?
Date: Fri, 07 Nov 2003 12:52:02 +0900 (JST) [thread overview]
Message-ID: <20031107.125202.755842752.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <37FBBA5F3A361C41AB7CE44558C3448E011959C7@pdsmsx403.ccr.corp.intel.com>
In article <37FBBA5F3A361C41AB7CE44558C3448E011959C7@pdsmsx403.ccr.corp.intel.com> (at Fri, 7 Nov 2003 11:00:55 +0800), "Zheng, Jeff" <jeff.zheng@intel.com> says:
> Is sockaddr_storage part of IPv6? I mean, does sockaddr_storage exist in a system that does not have IPv6? In such system if I use sockaddr_in6, the compile will be failed because there is no sockaddr_in6 structure.
AFAIK, sockaddr_storage{} was introduced because sockaddr_in6{}
is too large for sockaddr{}. However, the use of sockaddr_storage{}
is not limited to IPv6. Systems which does not support IPv6 may have
sockaddr_storage{}.
BTW, there're little chances for users to use sockaddr_in{} or sockaddr_in6{}.
Modern and "good" applications never use them.
Use getaddrinfo(3) / getnameinfo(3) (which uses addrinfo{} and sockaddr{}).
If you need a structure to hold socket address,
you may use sockaddr_storage{}; i.e. for getsockname(2) / getpeername(2).
If you are UNABLE to avoid touching socket address structure, use it finally;
This is very rare.
Well, this is kernel developmen list. Please change the list.
Thanks.
--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
next prev parent reply other threads:[~2003-11-07 3:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-07 3:00 Zheng, Jeff
2003-11-07 3:52 ` YOSHIFUJI Hideaki / 吉藤英明 [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-11-07 2:04 Zheng, Jeff
2003-11-07 2:23 ` YOSHIFUJI Hideaki / 吉藤英明
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031107.125202.755842752.yoshfuji@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=jeff.zheng@intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®