]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only listen to the UDP port if we opened it.
authorRoy Marples <roy@marples.name>
Mon, 3 Feb 2014 11:39:25 +0000 (11:39 +0000)
committerRoy Marples <roy@marples.name>
Mon, 3 Feb 2014 11:39:25 +0000 (11:39 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index f4a9a45dfb3a1fc131ab5f52c480b430adf4a900..2423301f08f9dfb67afe4acd87234e9e806360b9 100644 (file)
--- 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;
 }