summaryrefslogtreecommitdiffhomepage
path: root/src/config.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-10-16 10:42:16 +0200
committerSteven Barth <steven@midlink.org>2013-10-16 10:42:16 +0200
commit05969d06380387fc6d093e80b142145c2a9c2293 (patch)
treeb99f9c8b1743a2c0b59d6282b028b17ab1fee518 /src/config.c
parent86b63fbe80f9eea50543634f40da0b0a64e6ac02 (diff)
Minor fixes
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/config.c b/src/config.c
index d33309f..06e5407 100644
--- a/src/config.c
+++ b/src/config.c
@@ -282,10 +282,13 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
if (overwrite || !iface->ifname[0])
ifname = ubus_get_ifname(name);
#endif
- if ((c = tb[IFACE_ATTR_IFNAME]))
- ifname = blobmsg_get_string(c);
- else if ((c = tb[IFACE_ATTR_NETWORKID]))
- ifname = blobmsg_get_string(c);
+
+ if (overwrite) {
+ if ((c = tb[IFACE_ATTR_IFNAME]))
+ ifname = blobmsg_get_string(c);
+ else if ((c = tb[IFACE_ATTR_NETWORKID]))
+ ifname = blobmsg_get_string(c);
+ }
if (!iface->ifname[0] && !ifname)
return -1;
@@ -301,7 +304,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
if ((c = tb[IFACE_ATTR_DYNAMICDHCP]))
iface->no_dynamic_dhcp = !blobmsg_get_bool(c);
- if ((c = tb[IFACE_ATTR_IGNORE]))
+ if (overwrite && (c = tb[IFACE_ATTR_IGNORE]))
iface->ignore = blobmsg_get_bool(c);
if ((c = tb[IFACE_ATTR_LEASETIME])) {
@@ -340,7 +343,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
if ((c = tb[IFACE_ATTR_MASTER]))
iface->master = blobmsg_get_bool(c);
- if ((c = tb[IFACE_ATTR_UPSTREAM])) {
+ if (overwrite && (c = tb[IFACE_ATTR_UPSTREAM])) {
struct blob_attr *cur;
unsigned rem;