open_socket(iface, ETHERTYPE_ARP);
state->state = STATE_ANNOUNCING;
tv.tv_sec = ANNOUNCE_INTERVAL;
+ timeradd(&state->start, &tv, &state->timeout);
#else
state->state = STATE_BOUND;
tv.tv_sec = state->lease.renewaltime;
+ timeradd(&state->start, &tv, &state->stop);
#endif
- timeradd(&state->start, &tv, &state->timeout);
}
#endif
} else {
}
}
- if (options->timeout > 0 && !(state->options & DHCPCD_BACKGROUND)) {
+ if (options->timeout > 0 &&
+ !(state->options & DHCPCD_BACKGROUND) &&
+ !(state->options & DHCPCD_DAEMONISED))
+ {
tv.tv_sec = options->timeout;
tv.tv_usec = 0;
if (state->options & DHCPCD_IPV4LL) {
logger(LOG_ERR, "send_arp: %s", strerror(errno));
if (state->claims < ANNOUNCE_NUM)
tv.tv_sec = ANNOUNCE_INTERVAL;
- else if (IN_LINKLOCAL(htonl(lease->addr.s_addr))) {
+ else if (IN_LINKLOCAL(htonl(state->new->yiaddr))) {
/* We should pretend to be at the end
* of the DHCP negotation cycle */
state->state = STATE_INIT;