From: Roy Marples Date: Mon, 3 Feb 2014 11:39:25 +0000 (+0000) Subject: Only listen to the UDP port if we opened it. X-Git-Tag: v6.3.0~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d468029e193f44742c48859aa5bcf383511b9c0;p=thirdparty%2Fdhcpcd.git Only listen to the UDP port if we opened it. --- 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; }