dhcpcd-discuss

Re: dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequence

Roy Marples

Thu Sep 01 13:24:48 2016

On 01/09/2016 12:38, Roy Marples wrote:
> On 30/08/2016 21:35, Guy Yur wrote:
>> Adding IPv6 RA behavior for comparison (not affected by the DHCP/IPv4 patch).
>> With new patch:
>>
>> 1. ifconfig lan0 down
>> IPv4 address from DHCP is not removed.
>> IPv6 from RA is also not removed.
>>
>> 2. disconnect link on lan0 followed by reconnect link
>> IPv4 address from DHCP is removed and added back.
>> IPv6 from RA is also removed and added back.
>>
>> 3. 'ifconfig lan0 down' followed by disconnect link
>> IPv4 address from DHCP is not removed.
>> IPv6 from RA is removed.
> 
> While I cannot work out the behaviour differences, I can say for sure
> that FreeBSD sends RTM_DELADDR for each address on the interface when
> marked down. You can see this using route monitor.
> 
> This behaviour strikes me as incorrect as the address is clearly still
> on the interface.
> 
> For reference, NetBSD marks each address as IN{,6}_IFF_DETACHED and
> sends RTM_NEWADDR (because the address is still there) while other BSD's
> do nothing special.
> 
> As FreeBSD isn't in the habit of fixing any kernel issues I've reported
> over the years with dhcpcd I guess we'll have to add a workaround -
> maybe check with getifaddrs if the address still exists or not.

I don't know why, but the bogus RTM_DELADDR is only emitted for INET
addresses, not INET6. That explains the behaviour difference. So I'd say
it's definitely a bug in FreeBSD - it's inconsisent and for INET, wrong
IMHO.

Also, FreeBD (and OpenBSD so it's a good fix) don't set link down on
interface down gratuitously.

Worked around here:
http://roy.marples.name/projects/dhcpcd/ci/ad1a4b349d68a82b?sbs=0

Let me know how it works for you!

Roy

Follow-Ups:
Re: dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequenceGuy Yur
References:
dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequenceGuy Yur
Re: dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequenceRoy Marples
Re: dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequenceGuy Yur
Re: dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequenceRoy Marples
Re: dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequenceGuy Yur
Re: dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequenceRoy Marples
Archive administrator: postmaster@marples.name