]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix debug working in dhcpcd.conf
authorRoy Marples <roy@marples.name>
Mon, 23 Feb 2009 23:52:21 +0000 (23:52 +0000)
committerRoy Marples <roy@marples.name>
Mon, 23 Feb 2009 23:52:21 +0000 (23:52 +0000)
dhcpcd.c
if-options.c
if-options.h

index 41fc36f5ae584b69312d171a58823e60d58ecad0..7f0071d0bbe54e0766a155801eeb45cff27eb169 100644 (file)
--- 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
index da6f820858ce4db197f8aa54b8771f75e629d4b7..119d6dea3a944619b7230ec10a7df33226edb6c3 100644 (file)
@@ -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,
index 02f5f2dc83ccc79e4ceb0a995deaf2062b69990d..9b75f68e79738bd99e1259168ed61a0e4d2ad74b 100644 (file)
@@ -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)