tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PATCH to mark IPv6 addresses DETACHED when down or link down



On Saturday 20 August 2016 22:09:18 Matthew Mondor wrote:
>> Do any other OS's try to solve this problem?
>> 
>> Linux has IP_FREEBIND which allows you to bind to an address if it
>> doesn't exist or is tentative (they don't have the concept of
>> DETACHED, but the same logic could apply)
>> http://man7.org/linux/man-pages/man7/ip.7.html
>> 
>> FreeBSD has IP_BINDANY and IPV6_BINDANY which seems to do the same
>> thing
>> 
https://www.freebsd.org/cgi/man.cgi?query=ip&apropos=0&sektion=4&manpath=FreeBSD+11-current&arch=default&format=html
>
> These appear interesting, but if the daemons need to be modified to
> pass a special flag to be able to bind on a detached address, this
> would still be an issue with most non-patched software...

Well yes.

> 
> > There is also the easier approach of allowing bind(2) to use detached
> > addresses, but that doesn't help the PPPoE case or when the address
> > is in the tentative state.
> 
> The PPPoE case appears less of an issue to me, because at least it is
> understood that the address is not yet available.

Well, a detached address isn't available either.

We don't allow to bind to duplicated addresses for very good reasons.
We currently don't allow you to bind to detached or tentative addresses 
because, just like the duplicate address, it cannot be currently used.

The way I see it we have two choices
1) Allow bind to work for tentative and detached addresses (maybe even 
duplicated addresses?) without a socket option (after all, an address can 
become tentative, detached or duplicated even after being bound). We should 
our stack still DTRT for addresses in this state (fill the buffer until 
available or drop packets).

2) Keep the current contract where a successful bind call guarantees the 
address is currently usable. This means implementing one of the above flags and 
patching daemons - something which is happening outside of NetBSD anyway.

Roy


Home | Main Index | Thread Index | Old Index