[PATCH] timeout for all modes
Gerd v. Egidy
Wed Apr 28 12:21:42 2010
Hi,
One use (among others) of dhcpcd is to check that there is no other, unwanted
dhcp daemon listening on the network. To do this, I run dhcpcd in the test
mode without finally accepting an offered lease.
Without the attached patch, the test mode does not have a working timeout
which makes my usecase impossible. The patch enables the timeout for all
modes.
Please consider applying.
Kind regards,
Gerd
--
Address (better: trap) for people I really don't want to get mail from:
jonas@xxxxxxxxxxxxxxxxx
From 1aee8997501f38df03c3b3ab4990e7082b4ebc2e Mon Sep 17 00:00:00 2001
From: Gerd von Egidy <gerd.von.egidy@xxxxxxxxxxxxx>
Date: Wed, 28 Apr 2010 14:15:26 +0200
Subject: [PATCH] honour timeout in dhcpcd testmode too, not only in daemon mode
This way the testmode can be used to check that there is no dhcp daemon
answering requests on the network. This may be useful before starting
your own dhcpd.
---
dhcpcd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dhcpcd.c b/dhcpcd.c
index bc23934..bf6f60b 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1875,7 +1875,7 @@ main(int argc, char **argv)
{
syslog(LOG_WARNING, "no interfaces have a carrier");
daemonise();
- } else if (options & DHCPCD_DAEMONISE && ifo->timeout > 0) {
+ } else if (ifo->timeout > 0) {
if (options & DHCPCD_IPV4LL)
options |= DHCPCD_TIMEOUT_IPV4LL;
add_timeout_sec(ifo->timeout, handle_exit_timeout, NULL);
--
1.6.6.2
Archive administrator: postmaster@marples.name