In the Linux native code, we use the kernel IPv6 routing table
to figure out which scope_id value to use when a given Inet6Address
has no scope_id set. For the local link-local address, this
always points to the "lo" loopback interface, which is correct
for destination addresses, ie. packets are sent out the loopback
interface when the destination is the local LL address. However,
this is not correct when binding to a local address. In this
case, it doesn't make sense to set the scope_id to the loopback
interface because that would seem to preclude binding on physical
interfaces (which is normally what you want to do). This worked
ok on Linux kernels prior to 2.6 because presumably they just ignored
the scope_id setting in the bind() call. Unfortunately, it is broken
now in 2.6.
Linux should allow the application to use a scope_id of zero
which would force the kernel to try an figure out which interface
to use (in most cases it would be possible to determine it).
Since it does not do this, we need to use a different method
for determining the scope_id when binding to a local address.
In this case, we will search /proc/net/if_inet6 instead of
###@###.### 2005-1-04 13:31:44 GMT