> This is not really true. We can also specify the source address by
> the IPV6_PKTINFO socket option or ancillary data item defined the
> advanced API. This does not matter much, though, because we still
> need to specify a particular source address.
Good point. The issue is that the existing APIs can only support specifying
a specific source address, whether bind() or IPV6_PKTINFO is used. We
can make this more clear.
> I read this to mean unless IPV6_SRC_PREFERENCES is explicitly
> specified, the kernel will choose the default values for all the
> parameters. If my understanding is correct, how can I specify a
> preference for HOME vs COA but keep the default for TMP vs PUBLIC?
> Am I supposed to unset both IPV6_PREFER_SRC_TMP and
> IPV6_PREFER_SRC_PUBLIC? But isn't it a conflicting configuration
> since these two are exclusive flags?
If you do a setsockopt with IPV6_PREFER_SRC_HOME (or COA) and
do not set either of _TMP or _PUBLIC, then you will leave the
TMP vs. PUBLIC selection at the system default.
Thus not specifying either of "X" and "not X" leaves the "X" property of
the address selection at the system default.
> The current specification is at least unclear to me on this, and
> perhaps even contradicts itself. We could clarify this point, but I'm
> afraid the result would be complicated and unintuitive...
The questions on this point makes it clear to me that
the document is unclear :-)
An alternate API would be to have one flag per property and always require a
get before a set. An example of that style of API is fcntl with F_SETFL and
F_GETFL where the logic for setting e.g. FASYNC is
flags = fcntl(s, F_GETFL, NULL);
flags |= FASYNC;
fcntl(s, F_SETFL, flags);
and the logic for clearing it is:
flags = fcntl(s, F_GETFL, NULL);
flags &= ~FASYNC;
fcntl(s, F_SETFL, flags);
Something similar could be done using getsockopt and setsockopt
for the source preferences. But this would require a getsockopt
before the setsockopt to avoid accidentally changing some preferences.
Erik
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page: http://playground.sun.com/ipng
FTP archive: ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [EMAIL PROTECTED]
--------------------------------------------------------------------