From: Roy Marples Date: Fri, 30 Apr 2010 15:29:30 +0000 (+0000) Subject: Move -N to a config file only option so it does not conflict with X-Git-Tag: v5.2.3~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41c60e02b310e7666a3d786255404c593ee8af45;p=thirdparty%2Fdhcpcd.git Move -N to a config file only option so it does not conflict with the option from dhcpcd-4 --- diff --git a/if-options.c b/if-options.c index f8dd58d0..43f75ea2 100644 --- a/if-options.c +++ b/if-options.c @@ -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); diff --git a/if-options.h b/if-options.h index fe88ac80..86c101e8 100644 --- a/if-options.h +++ b/if-options.h @@ -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