changeset 2275:eb35eb681c59 draft

Only listen to the UDP port if we opened it.
author Roy Marples <roy@marples.name>
date Mon, 03 Feb 2014 11:39:25 +0000
parents c1d550c7e9ba
children 7799ec97af13
files dhcp.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dhcp.c	Mon Feb 03 11:02:17 2014 +0000
+++ b/dhcp.c	Mon Feb 03 11:39:25 2014 +0000
@@ -2610,7 +2610,8 @@
 			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;
 }