[En-Nut-Discussion] Possible race condition in DHCP and DHCPKick
Henrik Maier
hmnews at proconx.com
Thu May 9 01:38:40 CEST 2013
On 8/05/2013 11:03 PM, Harald Kipp wrote:
> On 11.02.2012 17:20, Ole Reinhardt wrote:
>
>> But shouldn't we change the other places as well:
>>
>> multiple times in NutDhcpClient()
>>
>> ...
>> NutEventBroadcast(&dhcpDone);
>> NutEventWait(&dhcpWake, NUT_WAIT_INFINITE);
>> ...
>>
>> To
>>
>> ... mutiple time:
>> NutEventBroadcastAsync(&dhcpDone);
>> NutEventWait(&dhcpWake, NUT_WAIT_INFINITE);
>> ...
>
> No, this is not required. dhcpWake is posted with NutEventPost(Async),
> empty queues are signaled. So NutEventWait will return immediately.
>
> The problem that Henrik reported appears only, because the DHCP thread
> uses NutEventBroadcast, which will not signal an empty queue.
>
Harald,
just to clarify, my fix should stay or?
Henrik
More information about the En-Nut-Discussion
mailing list