]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Be consistent with dhcient - always PREINIT on startup. We can use this to purge...
authorRoy Marples <roy@marples.name>
Thu, 14 Aug 2008 08:06:21 +0000 (08:06 +0000)
committerRoy Marples <roy@marples.name>
Thu, 14 Aug 2008 08:06:21 +0000 (08:06 +0000)
client.c
dhcpcd-hooks/50-ntp.conf
dhcpcd-run-hooks.8.in

index 66a7f9d31b7b54f66bb7ec6ac6b62730fbe9dfdb..3f3fe7b1015201a380816a728e2dfc1e7abe2bfe 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1740,13 +1740,12 @@ dhcp_run(const struct options *options, int *pid_fd)
                logger(LOG_ERR, "read_interface: %s", strerror(errno));
                goto eexit;
        }
-
        logger(LOG_DEBUG, "hardware address = %s",
               hwaddr_ntoa(iface->hwaddr, iface->hwlen));
-
        state = xzalloc(sizeof(*state));
        state->pid_fd = pid_fd;
        state->interface = iface;
+       run_script(options, iface->name, "PREINIT", NULL, NULL);
 
        if (client_setup(state, options) == -1)
                goto eexit;
@@ -1754,7 +1753,6 @@ dhcp_run(const struct options *options, int *pid_fd)
                goto eexit;
        if (signal_setup() == -1)
                goto eexit;
-
        state->signal_fd = signal_fd();
 
        if (state->options & DHCPCD_BACKGROUND &&
index 7528de74b2b7206970a4d80f4ea155ae2e0feed2..afbda9f7529c7dcde967d89a944fad64da4c17ef 100644 (file)
@@ -29,6 +29,7 @@ do_ntp_conf()
 }
 
 case "${reason}" in
+PREINIT)                                       clean_conf /etc/ntp.conf;;
 BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT)      do_ntp_conf add;;
 EXPIRE|FAIL|IPV4LL|RELEASE|STOP)               do_ntp_conf del;;
 esac
index fb435ccd5ca5c148e0902744c4822f4e1f16619d..72669f5110af8a807c8dffb73a27e7688cf8ff2b 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 13, 2008
+.Dd August 14, 2008
 .Dt DHCPCD.SH 8 SMM
 .Sh NAME
 .Nm dhcpcd-run-hooks
@@ -69,6 +69,8 @@ Here's a list of reasons why
 .Nm
 could be invoked:
 .Bl -tag -width indent
+.It Dv PREINIT
+dhcpcd is starting up and any pre-initialisation should be done.
 .It Dv INFORM
 dhcpcd informed a DHCP server about it's address and obtained other
 configuration details.