iface->start_uptime = uptime();
tv.tv_sec = lease->renewaltime - offset;
tv.tv_usec = 0;
- get_time(&state->timeout);
+ clock_monotonic(&state->timeout);
timeradd(&state->timeout, &tv, &state->timeout);
free(state->old);
state->old = state->new;
state->nakoff = 1;
state->options = options->options;
timerclear(&tv);
- get_time(&state->start);
+ clock_monotonic(&state->start);
if (options->request_address.s_addr == 0 &&
(options->options & DHCPCD_INFORM ||
}
ref = NULL;
- get_time(&now);
+ clock_monotonic(&now);
if (timerisset(&state->exit)) {
if (timercmp(&state->exit, &now, <=))
return 0;
}
wait_again:
- get_time(&now);
+ clock_monotonic(&now);
if (timeout == INFTIM)
last_stop_sec = INFTIM;
else {
tv.tv_sec = lease->renewaltime;
tv.tv_usec = 0;
- get_time(&state->stop);
+ clock_monotonic(&state->stop);
timeradd(&state->stop, &tv, &state->stop);
}
state->state = STATE_BOUND;
state->state);
}
- get_time(&state->start);
+ clock_monotonic(&state->start);
if (timerisset(&tv))
timeradd(&state->start, &tv, &state->stop);
timerclear(&state->timeout);
if (timerisset(&state->exit)) {
- get_time(&tv);
+ clock_monotonic(&tv);
if (timercmp(&tv, &state->exit, >))
return handle_timeout_fail(state, options);
}
iface->arp_fd = -1;
tv.tv_sec = lease->renewaltime -
(ANNOUNCE_INTERVAL * ANNOUNCE_NUM);
- get_time(&state->stop);
+ clock_monotonic(&state->stop);
timeradd(&state->stop, &tv, &state->stop);
return 0;
}
}
if (timerisset(&tv)) {
timerclear(&state->stop);
- get_time(&state->timeout);
+ clock_monotonic(&state->timeout);
timeradd(&state->timeout, &tv, &state->timeout);
return i;
}
if (timerisset(&state->stop)) {
- get_time(&tv);
+ clock_monotonic(&tv);
if (timercmp(&tv, &state->stop, >))
return handle_timeout_fail(state, options);
}
switch (state->state) {
case STATE_BOUND: /* FALLTHROUGH */
case STATE_RENEW_REQUESTED:
- get_time(&state->start);
+ clock_monotonic(&state->start);
timerclear(&state->stop);
/* FALLTHROUGH */
case STATE_INIT:
if (!lease->addr.s_addr && !timerisset(&state->stop)) {
tv.tv_sec = DHCP_MAX + DHCP_RAND_MIN;
tv.tv_usec = arc4random() % (DHCP_RAND_MAX_U - DHCP_RAND_MIN_U);
- get_time(&state->stop);
+ clock_monotonic(&state->stop);
timeradd(&state->stop, &tv, &state->stop);
}
break;
timerclear(&state->timeout);
return 0;
}
- get_time(&state->timeout);
+ clock_monotonic(&state->timeout);
tv.tv_sec = DHCP_BASE;
for (i = 1; i < state->messages; i++) {
tv.tv_sec *= 2;
state->nakoff *= 2;
if (state->nakoff > NAKOFF_MAX)
state->nakoff = NAKOFF_MAX;
- get_time(&state->timeout);
+ clock_monotonic(&state->timeout);
timeradd(&state->timeout, &tv, &state->timeout);
}
return 0;
send_message(state, DHCP_DECLINE, options);
do_socket(state, SOCKET_CLOSED);
state->state = STATE_INIT;
- get_time(&state->timeout);
+ clock_monotonic(&state->timeout);
tv.tv_sec = DHCP_ARP_FAIL;
tv.tv_usec = 0;
timeradd(&state->timeout, &tv, &state->timeout);
state->state = STATE_INIT_IPV4LL;
tv.tv_sec = PROBE_WAIT;
tv.tv_usec = 0;
- get_time(&state->timeout);
+ clock_monotonic(&state->timeout);
timeradd(&state->timeout, &tv, &state->timeout);
return 0;
}