]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
We need to move allow/deny back to options
authorRoy Marples <roy@marples.name>
Fri, 17 Apr 2009 13:31:08 +0000 (13:31 +0000)
committerRoy Marples <roy@marples.name>
Fri, 17 Apr 2009 13:31:08 +0000 (13:31 +0000)
if-options.c
if-options.h

index def471c727e79d7e53aeb76241ec3dbe7cb30849..8f52d9311412cb4dac5dd34535cdb1c26b4c5a5d 100644 (file)
@@ -48,9 +48,7 @@
 /* These options only make sense in the config file, so don't use any
    valid short options for them */
 #define O_BASE         MAX('z', 'Z') + 1
-#define O_ALOWIF       O_BASE + 1
-#define O_DENYIF       O_BASE + 2
-#define O_ARPING       O_BASE + 3
+#define O_ARPING       O_BASE + 1
 
 const struct option cf_options[] = {
        {"background",      no_argument,       NULL, 'b'},
@@ -73,6 +71,7 @@ const struct option cf_options[] = {
        {"userclass",       required_argument, NULL, 'u'},
        {"vendor",          required_argument, NULL, 'v'},
        {"exit",            no_argument,       NULL, 'x'},
+       {"allowinterfaces", required_argument, NULL, 'z'},
        {"reboot",          required_argument, NULL, 'y'},
        {"noarp",           no_argument,       NULL, 'A'},
        {"nobackground",    no_argument,       NULL, 'B'},
@@ -91,8 +90,7 @@ const struct option cf_options[] = {
        {"test",            no_argument,       NULL, 'T'},
        {"variables",       no_argument,       NULL, 'V'},
        {"blacklist",       required_argument, NULL, 'X'},
-       {"allowinterfaces", required_argument, NULL, O_ALOWIF},
-       {"denyinterfaces",  required_argument, NULL, O_DENYIF},
+       {"denyinterfaces",  required_argument, NULL, 'Z'},
        {"arping",          required_argument, NULL, O_ARPING},
        {NULL,              0,                 NULL, '\0'}
 };
@@ -481,6 +479,11 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                        return -1;
                }
                break;
+       case 'z':
+               /* We only set this if we haven't got any interfaces */
+               if (!ifaces)
+                       ifav = splitv(&ifac, ifav, arg);
+               break;
        case 'A':
                ifo->options &= ~DHCPCD_ARP;
                /* IPv4LL requires ARP */
@@ -658,6 +661,11 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                ifo->blacklist[ifo->blacklist_len++] = addr.s_addr;
                ifo->blacklist[ifo->blacklist_len++] = addr2.s_addr;
                break;
+       case 'Z':
+               /* We only set this if we haven't got any interfaces */
+               if (!ifaces)
+                       ifdv = splitv(&ifdc, ifdv, arg);
+               break;
        case O_ARPING:
                if (parse_addr(&addr, NULL, arg) != 0)
                        return -1;
@@ -665,16 +673,6 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                    sizeof(in_addr_t) * (ifo->arping_len + 1));
                ifo->arping[ifo->arping_len++] = addr.s_addr;
                break;
-       case O_ALOWIF:
-               /* We only set this if we haven't got any interfaces */
-               if (!ifaces)
-                       ifav = splitv(&ifac, ifav, arg);
-               break;
-       case O_DENYIF:
-               /* We only set this if we haven't got any interfaces */
-               if (!ifaces)
-                       ifdv = splitv(&ifdc, ifdv, arg);
-               break;
        default:
                return 0;
        }
index 4b64e29885602fd46be76b167bd088831c667e90..c6fcf882ba7c1fbe279eab2201ef5edb04580d79 100644 (file)
@@ -37,7 +37,7 @@
 
 /* Don't set any optional arguments here so we retain POSIX
  * compatibility with getopt */
-#define IF_OPTS "bc:def:h:i:kl:m:no:pqr:s:t:u:v:xy:ABC:DEF:GI:KLN:O:Q:TVX:"
+#define IF_OPTS "bc:def:h:i:kl:m:no:pqr:s:t:u:v:xy:z:ABC:DEF:GI:KLN:O:Q:TVX:Z:"
 
 #define DEFAULT_TIMEOUT                30
 #define DEFAULT_REBOOT         10