]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Move -N to a config file only option so it does not conflict with
authorRoy Marples <roy@marples.name>
Fri, 30 Apr 2010 15:29:30 +0000 (15:29 +0000)
committerRoy Marples <roy@marples.name>
Fri, 30 Apr 2010 15:29:30 +0000 (15:29 +0000)
the option from dhcpcd-4

if-options.c
if-options.h

index f8dd58d09d3adff9e695cae8309784b18b10153c..43f75ea2c37550f9ff16909016baca463052bed6 100644 (file)
@@ -52,6 +52,7 @@
 #define O_BASE         MAX('z', 'Z') + 1
 #define O_ARPING       O_BASE + 1
 #define O_FALLBACK     O_BASE + 2
+#define O_DESTINATION  O_BASE + 3
 
 const struct option cf_options[] = {
        {"background",      no_argument,       NULL, 'b'},
@@ -90,7 +91,6 @@ const struct option cf_options[] = {
        {"broadcast",       no_argument,       NULL, 'J'},
        {"nolink",          no_argument,       NULL, 'K'},
        {"noipv4ll",        no_argument,       NULL, 'L'},
-       {"destination",     required_argument, NULL, 'N'},
        {"nooption",        optional_argument, NULL, 'O'},
        {"require",         required_argument, NULL, 'Q'},
        {"static",          required_argument, NULL, 'S'},
@@ -100,6 +100,7 @@ const struct option cf_options[] = {
        {"blacklist",       required_argument, NULL, 'X'},
        {"denyinterfaces",  required_argument, NULL, 'Z'},
        {"arping",          required_argument, NULL, O_ARPING},
+       {"destination",     required_argument, NULL, O_DESTINATION},
        {"fallback",        required_argument, NULL, O_FALLBACK},
        {NULL,              0,                 NULL, '\0'}
 };
@@ -599,16 +600,6 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
        case 'L':
                ifo->options &= ~DHCPCD_IPV4LL;
                break;
-       case 'N':
-               if (make_option_mask(ifo->dstmask, arg, 2) != 0) {
-                       if (errno == EINVAL)
-                               syslog(LOG_ERR, "option `%s' does not take"
-                                   " an IPv4 address", arg);
-                       else
-                               syslog(LOG_ERR, "unknown otpion `%s'", arg);
-                       return -1;
-               }
-               break;
        case 'O':
                if (make_option_mask(ifo->requestmask, arg, -1) != 0 ||
                    make_option_mask(ifo->requiremask, arg, -1) != 0 ||
@@ -732,6 +723,16 @@ 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_DESTINATION:
+               if (make_option_mask(ifo->dstmask, arg, 2) != 0) {
+                       if (errno == EINVAL)
+                               syslog(LOG_ERR, "option `%s' does not take"
+                                   " an IPv4 address", arg);
+                       else
+                               syslog(LOG_ERR, "unknown option `%s'", arg);
+                       return -1;
+               }
+               break;
        case O_FALLBACK:
                free(ifo->fallback);
                ifo->fallback = xstrdup(arg);
index fe88ac809a905873480d81ded7481b1f5369dc47..86c101e8bbe12040dfe68eb4131cd7ca3c52a19b 100644 (file)
@@ -37,7 +37,7 @@
 
 /* Don't set any optional arguments here so we retain POSIX
  * compatibility with getopt */
-#define IF_OPTS "bc:de:f:gh:i:kl:m:no:pqr:s:t:u:v:wxy:z:ABC:DEF:GHI:JKLN:O:Q:S:TVW:X:Z:"
+#define IF_OPTS "bc:de:f:gh:i:kl:m:no:pqr:s:t:u:v:wxy:z:ABC:DEF:GHI:JKLO:Q:S:TVW:X:Z:"
 
 #define DEFAULT_TIMEOUT                30
 #define DEFAULT_REBOOT         10