case RENEW_REQUESTED:
case REBINDING:
if (*message == DHCPACK) {
+ unsigned start;
uint32_t lease_seconds;
struct in_addr temp_addr;
uint8_t *temp;
bb_info_msg("Lease of %s obtained, lease time %u",
inet_ntoa(temp_addr), (unsigned)lease_seconds);
requested_ip = packet.yiaddr;
+
+ start = monotonic_sec();
udhcp_run_script(&packet, state == REQUESTING ? "bound" : "renew");
+ already_waited_sec = (unsigned)monotonic_sec() - start;
state = BOUND;
change_listen_mode(LISTEN_NONE);
#endif
/* make future renew packets use different xid */
/* xid = random_xid(); ...but why bother? */
- already_waited_sec = 0;
+
continue; /* back to main loop */
}
if (*message == DHCPNAK) {