summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-02-23 23:52:21 +0000
committerRoy Marples <roy@marples.name>2009-02-23 23:52:21 +0000
commitacb1cf88cf6a35c5156908349c31de634f107141 (patch)
treeab8ad2d67bca30de9fcec67de055c12daaff76f9
parentab40c070d66713655a4d3e8839819ebab89e8529 (diff)
downloaddhcpcd-acb1cf88cf6a35c5156908349c31de634f107141.tar.xz
Fix debug working in dhcpcd.conf
-rw-r--r--dhcpcd.c7
-rw-r--r--if-options.c4
-rw-r--r--if-options.h1
3 files changed, 7 insertions, 5 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 41fc36f5..7f0071d0 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1281,9 +1281,6 @@ main(int argc, char **argv)
while ((opt = getopt_long(argc, argv, IF_OPTS, cf_options, &oi)) != -1)
{
switch (opt) {
- case 'd':
- setlogmask(LOG_UPTO(LOG_DEBUG));
- break;
case 'f':
cffile = optarg;
break;
@@ -1325,7 +1322,9 @@ main(int argc, char **argv)
options &= ~DHCPCD_DAEMONISE;
#endif
- if (options & DHCPCD_QUIET)
+ if (options & DHCPCD_DEBUG)
+ setlogmask(LOG_UPTO(LOG_DEBUG));
+ else if (options & DHCPCD_QUIET)
setlogmask(LOG_UPTO(LOG_WARNING));
/* If we have any other args, we should run as a single dhcpcd instance
diff --git a/if-options.c b/if-options.c
index da6f8208..119d6dea 100644
--- a/if-options.c
+++ b/if-options.c
@@ -300,7 +300,6 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
struct rt *rt;
switch(opt) {
- case 'd': /* FALLTHROUGH */
case 'n': /* FALLTHROUGH */
case 'x': /* FALLTHROUGH */
case 'T': /* We need to handle non interface options */
@@ -311,6 +310,9 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
case 'c':
strlcpy(ifo->script, arg, sizeof(ifo->script));
break;
+ case 'd':
+ ifo->options |= DHCPCD_DEBUG;
+ break;
case 'h':
if (arg) {
s = parse_string(ifo->hostname,
diff --git a/if-options.h b/if-options.h
index 02f5f2dc..9b75f68e 100644
--- a/if-options.h
+++ b/if-options.h
@@ -53,6 +53,7 @@
#define DHCPCD_DOMAIN (1 << 2)
#define DHCPCD_GATEWAY (1 << 3)
#define DHCPCD_STATIC (1 << 4)
+#define DHCPCD_DEBUG (1 << 5)
#define DHCPCD_LASTLEASE (1 << 7)
#define DHCPCD_INFORM (1 << 8)
#define DHCPCD_REQUEST (1 << 9)