[systemd-devel] [PATCH 00/11] Finalize initial DHCP support

Tom Gundersen teg at jklm.no
Sun Dec 22 05:18:03 PST 2013


On Fri, Dec 20, 2013 at 6:47 PM, Marcel Holtmann <marcel at holtmann.org> wrote:
> Hi Tom,
>
>>>> The first seven patches fix a few issues with the current code.
>>>>
>>>> Patch 09 adds DHCP lease renewing support when timer T1 triggers. Using
>>>> the UDP socket sending implementation in patch 08, the DHCP lease
>>>> renewal is unicasted to the DHCP server. This means that systemd-network
>>>> should have applied the acquired IP address and default route to the
>>>> proper interface before timer T1 triggers.
>>>
>>> this could become racy and we might end up in funny cases if the lease is really small. I think networkd and the DHCP need some way of communicating a) I set the IP you told me and/or b) we have T1 triggering, have you set the address or should I just redo the DHCP process.
>>
>> Makes sense to me for networkd to call (something like)
>> sd_dhcp_client_address_configured(client, true) whenever it has
>> successfully set the addresses/routes. I.e., I'd go with option (a).
>> Or is there a reason to go with (b) that I'm not seeing?
>
> the case I see is that T1 is triggered, but the IP address is not set. Then of course we should not be setting it anymore since it might not stay valid.
>
> However this could be done by DHCP itself just deciding that if client_address_configured is not called by the the time T1 expired, let the DHCP code redo the DHCP discovery.

Yeah, that makes sense.

> For good measure we should have warnings in the code for these unlikely race scenarios and see if someone is actually able to trigger them. With ConnMan, I do not recall we had bug reports of this. However we do not know what funny cases happen with virtualization and containers.

Agreed.

-t


More information about the systemd-devel mailing list