In message <[email protected]>
Michael Richardson writes:
> >>>>> "Brian" == Brian E Carpenter <[email protected]> writes:
> Brian> Really? I can't test it in my current native-IPv6-deprived
> Brian> state, but it seems to me that Windows (at least) runs
> Brian> happily with multiple IPv6 addresses on one interface, and I
>
> Linux too, and sometimes this is a bad thing.
> If you suspend/resume between home/work wired, I've had the problem
> where I can't reach the other because said address still lingering on
> interface makes my laptop think it's still "on the wire" with both.
> (you have to suspend-then-unplug, otherwise, disconnecting the cable
> works as a clue to flush the addresses)
>
>
> Michael Richardson <[email protected]>, Sandelman Software Works
When in doubt RTFC. Digression follows, possibly with something
relevant at the end, but maybe more for DHC WG.
dhclient.c makes use of dhclient-script
BOUND|RENEW|REBIND|REBOOT)
check_hostname
if [ -n "$old_ip_address" ]; then
if [ "$old_ip_address" != "$alias_ip_address" ]; then
delete_old_alias
fi
if [ "$old_ip_address" != "$new_ip_address" ]; then
delete_old_address
delete_old_routes
fi
fi
That look to me like the old address is deleted, *then* the new
address is added whenever the lease that has been selected out of
multiple offers is not the one that had previously been selected.
This is dhclient on freebsd which is a DHCPv4 client.
Looking at the ISC DHCP client (also dhclient, but with DHCPv6
support) I find much different code.
if [ ${reason} = BOUND6 ] ; then
# ...
ifconfig ${interface} inet6 ${new_ip6_address}/${new_ip6_prefixlen} alias
# ...
exit_with_hooks 0
fi
if [ ${reason} = EXPIRE6 -o ${reason} = RELEASE6
-o ${reason} = STOP6 ] ; then
# ...
ifconfig ${interface} inet6 ${old_ip6_address}/${old_ip6_prefixlen} -alias
# ...
exit_with_hooks 0
fi
In this case, an expire or release is needed to remove an old lease.
It may be that if your DHCP server never had the chance to remove a
lease and you did suspend and plug in somewhere else and get a new
lease, then the old lease will hang around until it expires,
potentially days. That may be a bug.
Your Linux box is then left free to bind new sockets to the old
address and there is no way to mark it as old and avoid it.
The behaviour I suggested earlier was (briefly):
1. Install new address as an alias (ie: ifconfig ... alias)
2. Avoid binding sockets to old address (see below)
3. Make sure old address is no longer in use (as best as possible),
then remove old address with a -alias (ie: ifconfig ... -alias).
That is not what is being done in either case.
There is currently no kernel mechanism for step 2 above. (Note:
prefer_source is close but not quite). What is needed is something
that modifies an alias such that it is not considered in the selection
but keeps it. (Possible syntax: "ifconfig ... stale" where stale
replaces the alias or -alias, modifying an existing alias). A new
interface address flag (as in ifa_flags) might do the trick if used
with the SIOCAIFADDR ioctl, however ifaliasreq doesn't have a place
for a set of flags. It could be that IFF_DYING could be set on the
ifa_flags in the struct ifaddr contained in either struct in6_ifaddr
or struct in_ifaddr. IFF_DYING can currently be set on an interface
but not on an address and it is only set internally to the kernel. It
is only referenced in sys/net/if.c in all of the BSD source and there
only four places. This would be an appropriate reuse of that flag bit
that would not conflict with the existing use (in the ifnet struct).
In any case, this is more appropriate for DHC (if at all) and even DHC
isn't chartered with patching the kernel, or changing ifconfig and isc
dhcp client, but it could recommend behavior when the lease changes.
Curtis
_______________________________________________
homenet mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/homenet