]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
New configure reasons NOCARRIER and NAK instead of just sending EXPIRE.
authorRoy Marples <roy@marples.name>
Thu, 15 Jan 2009 09:30:11 +0000 (09:30 +0000)
committerRoy Marples <roy@marples.name>
Thu, 15 Jan 2009 09:30:11 +0000 (09:30 +0000)
dhcpcd-hooks/20-resolv.conf
dhcpcd-hooks/50-ntp.conf
dhcpcd-hooks/50-yp.conf
dhcpcd-run-hooks.8.in
dhcpcd.c

index 601ef0ad69f35fb0d7b52286a2c62e538f730b32..357dddc4bbe5d6471e259139dd060ba896d9adc7 100644 (file)
@@ -120,5 +120,5 @@ remove_resolv_conf()
 
 case "${reason}" in
 BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)       add_resolv_conf;;
-PREINIT|EXPIRE|FAIL|IPV4LL|RELEASE|STOP)               remove_resolv_conf;;
+PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) remove_resolv_conf;;
 esac
index 3193cb2d9deca7434b3ea53b6abebd1e581b4c3d..1a25e31c814f2c10d96cfcf92d1d550decf2e7ee 100644 (file)
@@ -85,5 +85,5 @@ remove_ntp_conf()
 
 case "${reason}" in
 BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)       add_ntp_conf add;;
-PREINIT|EXPIRE|FAIL|IPV4LL|RELEASE|STOP)               remove_ntp_conf del;;
+PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) remove_ntp_conf del;;
 esac
index 6060696e9000ee039b43163395b4b8d04d3f7966..2758606d73806cfa49720d3bec556d3ff175197e 100644 (file)
@@ -45,5 +45,5 @@ restore_yp_conf()
 
 case "${reason}" in
 BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)       make_yp_conf;;
-EXPIRE|FAIL|IPV4LL|RELEASE|STOP)                       restore_yp_conf;;
+EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP)         restore_yp_conf;;
 esac
index a2e4951d56911bece23d97318dd021e1a1ac3105..dcc2f60a4fe14f8f8952d30c758604607f9f5594 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd January 1, 2008
+.Dd January 15, 2009
 .Dt DHCPCD.SH 8 SMM
 .Sh NAME
 .Nm dhcpcd-run-hooks
@@ -68,7 +68,7 @@ argument.
 Here's a list of reasons why
 .Nm
 could be invoked:
-.Bl -tag -width indent
+.Bl -tag -width PREINIT
 .It Dv PREINIT
 dhcpcd is starting up and any pre-initialisation should be done.
 .It Dv INFORM
@@ -82,22 +82,30 @@ dhcpcd renewed it's lease.
 dhcpcd has rebound to a new DHCP server.
 .It Dv REBOOT
 dhcpcd successfully requested a lease from a DHCP server.
-.It Dv EXPIRE
-dhcpcd's lease or state expired and it failed to obtain a new one.
 .It Dv IPV4LL
 dhcpcd failed to contact any DHCP servers but did obtain an IPV4LL address.
-.It Dv FAIL
-dhcpcd failed to contact any DHCP servers or use an old lease.
+.It Dv STATIC
+dhcpcd has been configured with a static configuration which has not been
+obtained from a DHCP server.
 .It Dv TIMEOUT
 dhcpcd failed to contact any DHCP servers but was able to use an old lease.
+.It Dv EXPIRE
+dhcpcd's lease or state expired and it failed to obtain a new one.
+.It Dv NAK
+dhcpcd received a NAK from the DHCP server.
+This should be treated as EXPIRE.
+.It Dv NOCARRIER
+dhcpcd lost the carrier.
+The cable may have been unplugged or association to the wireless point lost.
+.It Dv FAIL
+dhcpcd failed to contact any DHCP servers or use an old lease.
+.It Dv STOP
+dhcpcd will stop running on the interface.
 .It Dv TEST
 dhcpcd received an OFFER from a DHCP server but will not configure the
 interface.
 This is primarily used to test the variables are filled correctly for the
 script to process them.
-.It Dv STATIC
-dhcpcd has been configured with a static configuration which has not been
-obtained from a DHCP server.
 .El
 .Sh FILES 
 When
index f9e120cf065dfecfe8dc3888cf63e4795a58fd44..3b466a4b1ec9bd99240ffcdb5cfa319cdf982c53 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -449,7 +449,7 @@ handle_dhcp(struct interface *iface, struct dhcp_message **dhcpp)
        /* We should restart on a NAK */
        if (type == DHCP_NAK) {
                log_dhcp(LOG_WARNING, "NAK:", iface, dhcp);
-               drop_config(iface, "EXPIRE");
+               drop_config(iface, "NAK");
                unlink(iface->leasefile);
                delete_event(iface->raw_fd);
                close(iface->raw_fd);
@@ -726,7 +726,7 @@ handle_carrier(const char *ifname)
                        syslog(LOG_INFO, "%s: carrier lost", iface->name);
                        close_sockets(iface);
                        delete_timeouts(iface, start_expire, NULL);
-                       drop_config(iface, "EXPIRE");   
+                       drop_config(iface, "NOCARRIER");        
                }
                break;
        default: