mirror of
https://git.busybox.net/udhcp
synced 2025-10-14 01:59:23 +08:00
udhcp mistakenly closes its own port (bug 1295)
This commit is contained in:
4
dhcpc.c
4
dhcpc.c
@@ -51,7 +51,7 @@ static unsigned long requested_ip; /* = 0 */
|
||||
static unsigned long server_addr;
|
||||
static unsigned long timeout;
|
||||
static int packet_num; /* = 0 */
|
||||
static int fd;
|
||||
static int fd = -1;
|
||||
static int signal_pipe[2];
|
||||
|
||||
#define LISTEN_NONE 0
|
||||
@@ -109,7 +109,7 @@ static void change_mode(int new_mode)
|
||||
{
|
||||
DEBUG(LOG_INFO, "entering %s listen mode",
|
||||
new_mode ? (new_mode == 1 ? "kernel" : "raw") : "none");
|
||||
close(fd);
|
||||
if (fd >= 0) close(fd);
|
||||
fd = -1;
|
||||
listen_mode = new_mode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user