Only listen to the UDP port if we opened it.

This commit is contained in:
Roy Marples 2014-02-03 11:39:25 +00:00
parent fdff5377bf
commit 2d468029e1

3
dhcp.c
View File

@ -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;
}