]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't run the script with NAK when testing.
authorRoy Marples <roy@marples.name>
Sat, 11 Jul 2009 20:00:03 +0000 (20:00 +0000)
committerRoy Marples <roy@marples.name>
Sat, 11 Jul 2009 20:00:03 +0000 (20:00 +0000)
dhcpcd.c

index 6df84b394d4f90d7aa065c83ac96af6a52422f7a..232eeeeefea4fe9bbdf7e100decdd2248882eba8 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -475,8 +475,10 @@ handle_dhcp(struct interface *iface, struct dhcp_message **dhcpp)
                }
                /* We should restart on a NAK */
                log_dhcp(LOG_WARNING, "NAK:", iface, dhcp);
-               drop_config(iface, "NAK");
-               unlink(iface->leasefile);
+               if (!(options & DHCPCD_TEST)) {
+                       drop_config(iface, "NAK");
+                       unlink(iface->leasefile);
+               }
                delete_event(iface->raw_fd);
                close(iface->raw_fd);
                iface->raw_fd = -1;