diff options
author | sbyx <steven@midlink.org> | 2014-01-14 06:53:10 -0800 |
---|---|---|
committer | sbyx <steven@midlink.org> | 2014-01-14 06:53:10 -0800 |
commit | f15a59899a18e2bfaf839461adf54106e1c48b34 (patch) | |
tree | 5b2210dc4bb210659a932351930b706b913e324c | |
parent | fccc53a8947946b9c8ee1cc5e3e038cf4afc8e17 (diff) | |
parent | 4d5d803c929092eb07db5717650224afbde59d55 (diff) |
Merge pull request #7 from dedeckeh/bugfixes
Fix interface ignore overwrite
-rw-r--r-- | src/config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 46137a4..b6b3708 100644 --- a/src/config.c +++ b/src/config.c @@ -302,6 +302,9 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if (ifname) strncpy(iface->ifname, ifname, sizeof(iface->ifname) - 1); + if ((iface->ifindex = if_nametoindex(iface->ifname)) <= 0) + return -1; + iface->inuse = true; if ((c = tb[IFACE_ATTR_DYNAMICDHCP])) @@ -494,7 +497,6 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr } } - iface->ignore = (iface->ifindex = if_nametoindex(iface->ifname)) <= 0; return 0; err: |