diff options
| author | Roy Marples <roy@marples.name> | 2009-04-18 21:43:23 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-04-18 21:43:23 +0000 |
| commit | ff021b0b5dc1b9060b45e0451d02f1bf58cc75fc (patch) | |
| tree | 31b5d125a355b438139fd26364582a9508cdc61a /if-options.c | |
| parent | 623330decced8f8eeb1868a57ae687d40c39dad1 (diff) | |
| download | dhcpcd-ff021b0b5dc1b9060b45e0451d02f1bf58cc75fc.tar.xz | |
Add an option to fallback to a profile when DHCP fails.
Diffstat (limited to 'if-options.c')
| -rw-r--r-- | if-options.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/if-options.c b/if-options.c index 8f52d931..81226978 100644 --- a/if-options.c +++ b/if-options.c @@ -49,6 +49,7 @@ valid short options for them */ #define O_BASE MAX('z', 'Z') + 1 #define O_ARPING O_BASE + 1 +#define O_FALLBACK O_BASE + 2 const struct option cf_options[] = { {"background", no_argument, NULL, 'b'}, @@ -92,6 +93,7 @@ const struct option cf_options[] = { {"blacklist", required_argument, NULL, 'X'}, {"denyinterfaces", required_argument, NULL, 'Z'}, {"arping", required_argument, NULL, O_ARPING}, + {"fallback", required_argument, NULL, O_FALLBACK}, {NULL, 0, NULL, '\0'} }; @@ -673,6 +675,10 @@ 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_FALLBACK: + free(ifo->fallback); + ifo->fallback = xstrdup(arg); + break; default: return 0; } @@ -831,7 +837,9 @@ free_options(struct if_options *ifo) free(ifo->config); } free_routes(ifo->routes); + free(ifo->arping); free(ifo->blacklist); + free(ifo->fallback); free(ifo); } } |
