summaryrefslogtreecommitdiffhomepage
path: root/src/config.c
diff options
context:
space:
mode:
authorHans Dedecker <hans.dedecker@technicolor.com>2016-12-05 09:57:12 +0100
committerHans Dedecker <dedeckeh@gmail.com>2016-12-12 10:02:58 +0100
commit3af23ad72888393a863d7be545d1bd5af99ca442 (patch)
tree29d08e8c21a5fd4ac0344a32aa24f55ed8bcc91e /src/config.c
parent41b52688403016017eca812315a7206b6d27c097 (diff)
config: Fix RA interface config being overwritten
In case multiple dhcp uci sections are configured and one section contains RA config while the other section does not; the RA interface config of the first section will be overwritten by the second section. Fix this by setting the default values for ra_management and ndp_proxy_routing uci parameters when the interface is created and by removing the overwrite check Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/config.c b/src/config.c
index 8b0d945..372ea67 100644
--- a/src/config.c
+++ b/src/config.c
@@ -333,6 +333,11 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
return -1;
strncpy(iface->name, name, sizeof(iface->name) - 1);
+
+ /* Default settings */
+ iface->managed = 1;
+ iface->learn_routes = true;
+
list_add(&iface->head, &interfaces);
overwrite = true;
}
@@ -533,8 +538,6 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
if ((c = tb[IFACE_ATTR_RA_MANAGEMENT]))
iface->managed = blobmsg_get_u32(c);
- else if (overwrite)
- iface->managed = 1;
if ((c = tb[IFACE_ATTR_RA_OFFLINK]))
iface->ra_not_onlink = blobmsg_get_bool(c);
@@ -568,8 +571,6 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
if ((c = tb[IFACE_ATTR_NDPROXY_ROUTING]))
iface->learn_routes = blobmsg_get_bool(c);
- else if (overwrite)
- iface->learn_routes = true;
if ((c = tb[IFACE_ATTR_NDPROXY_SLAVE]))
iface->external = blobmsg_get_bool(c);