next_timeout += (random_u32() & 0x1fffff);
- r = sd_event_add_monotonic(client->event, next_timeout,
+ r = sd_event_add_monotonic(client->event,
+ &client->timeout_resend,
+ next_timeout,
10 * USEC_PER_MSEC,
- client_timeout_resend, client,
- &client->timeout_resend);
+ client_timeout_resend, client);
if (r < 0)
goto error;
assert(client);
assert(client->event);
- r = sd_event_add_io(client->event, client->fd, EPOLLIN, io_callback,
- client, &client->receive_message);
+ r = sd_event_add_io(client->event, &client->receive_message,
+ client->fd, EPOLLIN, io_callback,
+ client);
if (r < 0)
goto error;
if (r < 0)
goto error;
- r = sd_event_add_monotonic(client->event, usec, 0,
- client_timeout_resend, client,
- &client->timeout_resend);
+ r = sd_event_add_monotonic(client->event,
+ &client->timeout_resend,
+ usec, 0,
+ client_timeout_resend, client);
if (r < 0)
goto error;
if (next_timeout < usec)
return -EINVAL;
- r = sd_event_add_monotonic(client->event, next_timeout,
+ r = sd_event_add_monotonic(client->event,
+ &client->timeout_t1,
+ next_timeout,
10 * USEC_PER_MSEC,
- client_timeout_t1, client,
- &client->timeout_t1);
+ client_timeout_t1, client);
if (r < 0)
return r;
if (next_timeout < usec)
return -EINVAL;
- r = sd_event_add_monotonic(client->event, next_timeout,
+ r = sd_event_add_monotonic(client->event,
+ &client->timeout_t2,
+ next_timeout,
10 * USEC_PER_MSEC,
- client_timeout_t2, client,
- &client->timeout_t2);
+ client_timeout_t2, client);
if (r < 0)
return r;
if (next_timeout < usec)
return -EINVAL;
- r = sd_event_add_monotonic(client->event, next_timeout,
+ r = sd_event_add_monotonic(client->event,
+ &client->timeout_expire, next_timeout,
10 * USEC_PER_MSEC,
- client_timeout_expire, client,
- &client->timeout_expire);
+ client_timeout_expire, client);
if (r < 0)
return r;
client->state = DHCP_STATE_REQUESTING;
client->attempt = 1;
- r = sd_event_add_monotonic(client->event, time_now, 0,
+ r = sd_event_add_monotonic(client->event,
+ &client->timeout_resend,
+ time_now, 0,
client_timeout_resend,
- client,
- &client->timeout_resend);
+ client);
if (r < 0)
goto error;