Hi,
On Wed, 2014-01-22 at 15:31 +0000, Zhang, Zhengguang wrote:
> I don't suggest that the code should be factored in with
> send_select(), the reason is:
> send_select() is called when dhcp client has received DHCP_OFFER
> message from dhcp server, so dhcp client broadcasts a message with the
> server identifier to notify that it has selected a dhcp server.
> send_rebooting() does a totally different thing: in INIT_REBOOT state,
> dhcp client broadcasts a message with the requested IP address to
> request the previous allocated IP address directly, the max DHCP size
> should be set and "server identifier" must not be filled in. From
> logic, send_rebooting() has nothing to do with send_select(), although
> the codes are somewhere similar, it should not be combined into one
> function, otherwise, it will make the codes very confusing and not
> readable .
The only difference sending a Request is the server id when not in
init-reboot state. Surely that difference can be handled by checking
dhcp_client->state and reusing the rest of the identical code? IMHO the
function should also be called send_request(), as that's what it really
does.
Cheers,
Patrik
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman