]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't try to send messages when we infinite leasetime and the interface
authorRoy Marples <roy@marples.name>
Thu, 8 Feb 2007 09:40:22 +0000 (09:40 +0000)
committerRoy Marples <roy@marples.name>
Thu, 8 Feb 2007 09:40:22 +0000 (09:40 +0000)
fd is closed.

ChangeLog
Makefile
client.c

index 9ddb85a0492ef91c833d5a290814df638d28d35f..34929b7ab51f015898fbcca86909b92cf24df672 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+dhcpcd-3.0.11
+Don't try to send messages when we infinite leasetime and the interface
+fd is closed.
+
 dhcpcd-3.0.10
 Only write a new ntp.conf if any of our servers are not present in it.
 We now work with SIGCHLD and call wait so that we don't leave any
index 8b2511111dadd03c3b22b0662617ee4afd3ee8af..e5d5318b3c72a9523007966dd4b310e37df0499a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Should work for both GNU make and BSD make
 
-VERSION = 3.0.10
+VERSION = 3.0.11
 
 CFLAGS ?= -O2 -pipe
 
index 2fc3180a7dcf1752a2bcaa976d5107a53debbf3e..d069d5a29be58630b794af06f31b118f60d87b7c 100644 (file)
--- a/client.c
+++ b/client.c
@@ -181,18 +181,23 @@ int dhcp_run (const options_t *options)
              retval = 0;
              while (retval == 0)
                {
-                 /* Slow down our requests */
-                 if (retry < TIMEOUT_MINI_INF)
-                   retry += TIMEOUT_MINI;
-                 else if (retry > TIMEOUT_MINI_INF)
-                   retry = TIMEOUT_MINI_INF;
-
-                 tv.tv_sec = retry;
-                 tv.tv_usec = 0;
                  maxfd = signal_fd_set (&rset, iface->fd);
-                 retval = select (maxfd + 1, &rset, NULL, NULL, &tv);
-                 if (retval == 0)
-                   SEND_MESSAGE (last_type);
+                 if (iface->fd == -1)
+                   retval = select (maxfd + 1, &rset, NULL, NULL, NULL);
+                 else
+                   {
+                     /* Slow down our requests */
+                     if (retry < TIMEOUT_MINI_INF)
+                       retry += TIMEOUT_MINI;
+                     else if (retry > TIMEOUT_MINI_INF)
+                       retry = TIMEOUT_MINI_INF;
+
+                     tv.tv_sec = retry;
+                     tv.tv_usec = 0;
+                     retval = select (maxfd + 1, &rset, NULL, NULL, &tv);
+                     if (retval == 0)
+                       SEND_MESSAGE (last_type);
+                   }
                }
            }
          else