From 2d468029e193f44742c48859aa5bcf383511b9c0 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 3 Feb 2014 11:39:25 +0000 Subject: [PATCH] Only listen to the UDP port if we opened it. --- dhcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dhcp.c b/dhcp.c index f4a9a45d..2423301f 100644 --- a/dhcp.c +++ b/dhcp.c @@ -2610,7 +2610,8 @@ dhcp_open(struct interface *ifp) syslog(LOG_ERR, "%s: dhcp_openudp: %m", ifp->name); return -1; } - eloop_event_add(state->udp_fd, dhcp_handleudp, ifp); + if (state->udp_fd != -1) + eloop_event_add(state->udp_fd, dhcp_handleudp, ifp); } return 0; } -- 2.47.3