summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-02-08 16:36:02 +0100
committerHans Dedecker <dedeckeh@gmail.com>2017-02-09 09:39:58 +0100
commit0129f7926b9a0f993058dca9775e64021527eb32 (patch)
tree607b57046e531fc15e94b2782565b5ac64f02624
parent3317c861984ec22155c04dd77e77abb2ed8bb252 (diff)
config: restore interface defaults when cleaning interface
Interface defaults are whiped when clean interface is executed resulting into loss of default behavior for the ndproxy_routing and ra_management uci parameters Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r--src/config.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c
index ba51375..5174f2c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -180,6 +180,12 @@ static struct interface* get_interface(const char *name)
return NULL;
}
+static void set_interface_defaults(struct interface *iface)
+{
+ iface->managed = 1;
+ iface->learn_routes = 1;
+}
+
static void clean_interface(struct interface *iface)
{
free(iface->dns);
@@ -190,6 +196,7 @@ static void clean_interface(struct interface *iface)
free(iface->dhcpv6_raw);
free(iface->filter_class);
memset(&iface->ra, 0, sizeof(*iface) - offsetof(struct interface, ra));
+ set_interface_defaults(iface);
}
static void close_interface(struct interface *iface)
@@ -357,9 +364,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
strncpy(iface->name, name, sizeof(iface->name) - 1);
- /* Default settings */
- iface->managed = 1;
- iface->learn_routes = true;
+ set_interface_defaults(iface);
list_add(&iface->head, &interfaces);
overwrite = true;