aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/udhcp/dhcpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index dd55e70f4..9ad95954d 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -377,6 +377,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
377 /* Setup the signal pipe */ 377 /* Setup the signal pipe */
378 udhcp_sp_setup(); 378 udhcp_sp_setup();
379 379
380 continue_with_autotime:
380 timeout_end = monotonic_sec() + server_config.auto_time; 381 timeout_end = monotonic_sec() + server_config.auto_time;
381 while (1) { /* loop until universe collapses */ 382 while (1) { /* loop until universe collapses */
382 fd_set rfds; 383 fd_set rfds;
@@ -406,8 +407,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
406 } 407 }
407 if (retval == 0) { 408 if (retval == 0) {
408 write_leases(); 409 write_leases();
409 timeout_end = monotonic_sec() + server_config.auto_time; 410 goto continue_with_autotime;
410 continue;
411 } 411 }
412 if (retval < 0 && errno != EINTR) { 412 if (retval < 0 && errno != EINTR) {
413 log1("Error on select"); 413 log1("Error on select");
@@ -419,10 +419,10 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
419 bb_info_msg("Received SIGUSR1"); 419 bb_info_msg("Received SIGUSR1");
420 write_leases(); 420 write_leases();
421 /* why not just reset the timeout, eh */ 421 /* why not just reset the timeout, eh */
422 timeout_end = monotonic_sec() + server_config.auto_time; 422 goto continue_with_autotime;
423 continue;
424 case SIGTERM: 423 case SIGTERM:
425 bb_info_msg("Received SIGTERM"); 424 bb_info_msg("Received SIGTERM");
425 write_leases();
426 goto ret0; 426 goto ret0;
427 case 0: /* no signal: read a packet */ 427 case 0: /* no signal: read a packet */
428 break; 428 break;