summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHans Dedecker <hans.dedecker@technicolor.com>2014-01-13 17:42:19 +0100
committerHans Dedecker <hans.dedecker@technicolor.com>2014-01-13 17:42:19 +0100
commit4d5d803c929092eb07db5717650224afbde59d55 (patch)
tree5b2210dc4bb210659a932351930b706b913e324c
parent865c2b80b155c41b11cdc7e53d750fa1618114be (diff)
Fix interface ignore overwrite
Don't overwrite interface ignore uci parameter when resolving ifindex. Don't put interface in use when ifindex is unknown as interface cannot be setup and needs to be closed.
-rw-r--r--src/config.c4
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: