summaryrefslogtreecommitdiffstats
path: root/if-options.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-09-03 16:49:28 +0000
committerRoy Marples <roy@marples.name>2008-09-03 16:49:28 +0000
commitf43e585355e50bd2e7021380db6fc792662f76be (patch)
treed81565b32d67516b6ae178bcdbff09bda3251b45 /if-options.c
parentf0c98483e7369f2df38edc352433239fa24f6a2f (diff)
downloaddhcpcd-f43e585355e50bd2e7021380db6fc792662f76be.tar.xz
Add a control socket so that interfaces can be dynamically re-set.
This requires the event loop argument being changed to void * so we can send arguments other than an interface.
Diffstat (limited to 'if-options.c')
-rw-r--r--if-options.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/if-options.c b/if-options.c
index 836bf8de..f6f9140b 100644
--- a/if-options.c
+++ b/if-options.c
@@ -293,6 +293,8 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
}
*ifo->vendorclassid = (uint8_t)s;
break;
+ case 'k':
+ break;
case 'l':
if (*arg == '-') {
logger(LOG_ERR,
@@ -313,6 +315,8 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
return -1;
}
break;
+ case 'n':
+ break;
case 'o':
if (make_option_mask(ifo->requestmask, arg, 1) != 0) {
logger(LOG_ERR, "unknown option `%s'", arg);
@@ -557,6 +561,7 @@ read_config(const char *file, const char *ifname)
ifo->options |= DHCPCD_CLIENTID | DHCPCD_GATEWAY | DHCPCD_DAEMONISE;
ifo->options |= DHCPCD_ARP | DHCPCD_IPV4LL | DHCPCD_LINK;
ifo->timeout = DEFAULT_TIMEOUT;
+ ifo->metric = -1;
gethostname(ifo->hostname + 1, sizeof(ifo->hostname));
if (strcmp(ifo->hostname + 1, "(none)") == 0 ||
strcmp(ifo->hostname + 1, "localhost") == 0)
@@ -642,12 +647,14 @@ free_options(struct if_options *ifo)
{
size_t i;
- if (ifo->environ) {
- i = 0;
- while (ifo->environ[i])
- free(ifo->environ[i++]);
- free(ifo->environ);
+ if (ifo) {
+ if (ifo->environ) {
+ i = 0;
+ while (ifo->environ[i])
+ free(ifo->environ[i++]);
+ free(ifo->environ);
+ }
+ free(ifo->blacklist);
+ free(ifo);
}
- free(ifo->blacklist);
- free(ifo);
}