Re: dhcpcd 6.11.3 core dumps on FreeBSD with link disconnect/connect sequence
Guy Yur
Tue Aug 30 20:36:49 2016
Hi Roy,
On Tue, Aug 30, 2016 at 10:31 PM, Roy Marples <roy@xxxxxxxxxxxx> wrote:
> Hi Guy
>
> On Tuesday 30 August 2016 20:46:55 Guy Yur wrote:
>> dhcpcd with the patch no longer crashes on the above sequence.
>
> yay!
>
>> What should happen to the IPv4 address when the interface
>> goes down or when the link is lost?
>>
>> Before the patch,
>> 1. ifconfig lan0 down
>> ifconfig lan0 -> ipv4 address from dhcp was removed
>> 2. ifconfig lan0 up
>> ifconfig lan0 -> ipv4 address from dhcp was not restored (waited one minute)
>>
>> 1. link disconnected on lan0
>> ifconfig lan0 -> ipv4 address from dhcp was removed
>> 2. link reconnected on lan0
>> ifconfig lan0 -> ipv4 address from dhcp was added after a few seconds
>>
>>
>> After the patch,
>> 1. ifconfig lan0 down
>> ifconfig lan0 -> ipv4 address from dhcp was not removed
>> 2. ifconfig lan0 up
>>
>> 1. link disconnected on lan0
>> ifconfig lan0 -> ipv4 address from dhcp was not removed
>> 2. link reconnected on lan0
>
> In both cases the address should be restored at the last step.
> I will try and test more on BSD tomorrow.
>
> One potential problem is that ifa_msghdr does not carry the PID of the
> originating process which deleted the address and if there is a delay
> receiving it, dhcpcd can get confused.
>
> We may have to extend the kernel structure so it can carry the pid to make it
> a lot tighter.
>
> Attached is a new dhcpcd patch which may help.
> Let me know.
>
> Roy
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.
Thanks,
Guy
Archive administrator: postmaster@marples.name