sd-dhcp: make sure client->secs > 0

Some DHCP servers will not work correctly if secs == 0, so round up
to at least 1.
This commit is contained in:
Tom Gundersen 2014-02-12 16:59:52 +01:00
parent 60ad0c85e5
commit c6f7b693fe
1 changed files with 1 additions and 1 deletions

View File

@ -338,7 +338,7 @@ static int client_send_request(sd_dhcp_client *client, uint16_t secs) {
static uint16_t client_update_secs(sd_dhcp_client *client, usec_t time_now)
{
client->secs = (time_now - client->start_time) / USEC_PER_SEC;
client->secs = ((time_now - client->start_time) / USEC_PER_SEC) ? : 1;
return client->secs;
}