From: Roy Marples Date: Thu, 8 Feb 2007 09:40:22 +0000 (+0000) Subject: Don't try to send messages when we infinite leasetime and the interface X-Git-Tag: v3.2.3~317 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37aeb387c5dec2138b1f0e3261b19eef12b82ebc;p=thirdparty%2Fdhcpcd.git Don't try to send messages when we infinite leasetime and the interface fd is closed. --- diff --git a/ChangeLog b/ChangeLog index 9ddb85a0..34929b7a 100644 --- 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 diff --git a/Makefile b/Makefile index 8b251111..e5d5318b 100644 --- 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 diff --git a/client.c b/client.c index 2fc3180a..d069d5a2 100644 --- 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