]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Allow other processes to handle the DHCP port on the wildcard address.
authorRoy Marples <roy@marples.name>
Tue, 9 Dec 2014 12:52:52 +0000 (12:52 +0000)
committerRoy Marples <roy@marples.name>
Tue, 9 Dec 2014 12:52:52 +0000 (12:52 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 43d4aaeadd2d717819447bfb2ec0371cc4f4ce9c..b9a6fb1e90dcc8ee3796b798577e782db876ae26 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -3074,11 +3074,14 @@ dhcp_start1(void *arg)
        if (ifp->ctx->udp_fd == -1) {
                ifp->ctx->udp_fd = dhcp_openudp(NULL);
                if (ifp->ctx->udp_fd == -1) {
-                       syslog(LOG_ERR, "dhcp_openudp: %m");
-                       return;
-               }
-               eloop_event_add(ifp->ctx->eloop,
-                   ifp->ctx->udp_fd, dhcp_handleudp, ifp->ctx, NULL, NULL);
+                       /* Don't log an error if some other process
+                        * is handling this. */
+                       if (errno != EADDRINUSE)
+                               syslog(LOG_ERR, "dhcp_openudp: %m");
+               } else
+                       eloop_event_add(ifp->ctx->eloop,
+                           ifp->ctx->udp_fd, dhcp_handleudp,
+                           ifp->ctx, NULL, NULL);
        }
 
        if (dhcp_init(ifp) == -1) {