aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r--networking/udhcp/dhcpd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 6e426e6a2..022b8721b 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -37,6 +37,8 @@
37//usage: IF_FEATURE_UDHCP_PORT( 37//usage: IF_FEATURE_UDHCP_PORT(
38//usage: "\n -P N Use port N (default 67)" 38//usage: "\n -P N Use port N (default 67)"
39//usage: ) 39//usage: )
40//usage: "\nSignals:"
41//usage: "\n USR1 Update lease file"
40 42
41#include <netinet/ether.h> 43#include <netinet/ether.h>
42#include <syslog.h> 44#include <syslog.h>
@@ -863,6 +865,10 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
863 IF_FEATURE_UDHCP_PORT(SERVER_PORT = 67;) 865 IF_FEATURE_UDHCP_PORT(SERVER_PORT = 67;)
864 IF_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;) 866 IF_FEATURE_UDHCP_PORT(CLIENT_PORT = 68;)
865 867
868 /* Make sure fd 0,1,2 are open */
869 /* Setup the signal pipe on fds 3,4 - must be before openlog() */
870 udhcp_sp_setup();
871
866 opt = getopt32(argv, "^" 872 opt = getopt32(argv, "^"
867 "fSI:va:"IF_FEATURE_UDHCP_PORT("P:") 873 "fSI:va:"IF_FEATURE_UDHCP_PORT("P:")
868 "\0" 874 "\0"
@@ -904,9 +910,6 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
904 if (server_data.auto_time > INT_MAX / 1000) 910 if (server_data.auto_time > INT_MAX / 1000)
905 server_data.auto_time = INT_MAX / 1000; 911 server_data.auto_time = INT_MAX / 1000;
906 912
907 /* Make sure fd 0,1,2 are open */
908 bb_sanitize_stdio();
909
910 /* Create pidfile */ 913 /* Create pidfile */
911 write_pidfile(server_data.pidfile); 914 write_pidfile(server_data.pidfile);
912 /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */ 915 /* if (!..) bb_perror_msg("can't create pidfile %s", pidfile); */
@@ -942,9 +945,6 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
942 goto ret; 945 goto ret;
943 } 946 }
944 947
945 /* Setup the signal pipe */
946 udhcp_sp_setup();
947
948 continue_with_autotime: 948 continue_with_autotime:
949 timeout_end = monotonic_sec() + server_data.auto_time; 949 timeout_end = monotonic_sec() + server_data.auto_time;
950 while (1) { /* loop until universe collapses */ 950 while (1) { /* loop until universe collapses */