James Carlson wrote:

Darren Reed writes:
You need to make this problem statement more detailed as it is
possible to use bind() to select a source address for UDP packets
but not in the scenario you're referring to here.

Indeed.  The problem is that the user must either bind a zillion
sockets (one for each local address on the system), using SIOCGIFCONF
and then either polling or using routing sockets to keep track of
interfaces that get reconfigured, or must bind/unbind for each packet
he wants to send.

Both are quite ugly, and application writers often get them wrong.
...
No.  That won't work at all.  The code above is reading and writing
only the sticky options, which have nothing to do with received
packets.

Even if we could somehow make that work (we can't, and it's not how
getsockopt has _ever_ functioned for _any_ option), it would not be
thread-safe.

You must use ancillary data for this feature.  The fact that it ends
up "working" with sticky data as well is a minor feature, and not a
very important one.

Given these comments, and others in this thread, an update to
the manual pages that provides an example of how to use the
extended information features of the 3XNET functions should
be mandatory.
Using them is not obvious and examples are relatively hard to
find, on web pages, in documentation and in programs.

Darren

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to