netutils/dhcpd: change select timeout from 60s to 10s
authorJin-Seong Kim <jseong82.kim@samsung.com>
Thu, 20 Apr 2017 04:22:56 +0000 (13:22 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 23 May 2017 12:40:02 +0000 (21:40 +0900)
This commit is to change select timeout from 60s to 10s
 - 60s timeout is too long to stop dhcpd
 - 10s is enough time to wait for a dhcp handshake

Change-Id: I0d1f7d1b86ba6e46ac874fa364e86e9e9418a642
Signed-off-by: Jin-Seong Kim <jseong82.kim@samsung.com>
apps/netutils/dhcpd/dhcpd.c

index 31be3d0..c6035de 100644 (file)
@@ -309,7 +309,7 @@ static pthread_t g_tid = 0;
 static char DHCPD_IFNAME[IFNAMSIZ] = {0,};
 
 #if DHCPD_SELECT
-static struct timeval g_select_timeout = {60, 0};
+static struct timeval g_select_timeout = {10, 0};
 #endif
 
 /****************************************************************************
@@ -1590,9 +1590,6 @@ int dhcpd_run(void *arg)
                        /* Read the next g_state.ds_outpacket */
                        nbytes = recv(sockfd, &g_state.ds_inpacket, sizeof(struct dhcpmsg_s), 0);
                } else if (ret == 0) {
-                       /* Debugging purpose : Timeout case */
-                       ndbg("select ret %d [errno %d]\n", ret, errno);
-
                        if (!g_dhcpd_quit)
                                continue;
                        else {