summaryrefslogtreecommitdiffhomepage
path: root/interface.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2019-03-13 14:56:21 +0100
committerHans Dedecker <dedeckeh@gmail.com>2019-03-13 21:07:53 +0100
commit81ac3bce0157f96fbc31cf6e965eecb170e48c88 (patch)
treeb923f6a717bb5f1fd5959dc0ffc96b40ba46dc32 /interface.c
parent5cd7215a09ad440f0d1b1d05df8deb403f945898 (diff)
interface-ip: fix delegate config update on reload (FS#2087)
Update the no_delegation parameter on a config reload; in case prefixes are present update the prefix assignments as well according to the no_delegation status Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/interface.c b/interface.c
index b21d234..b8c4ae2 100644
--- a/interface.c
+++ b/interface.c
@@ -1197,7 +1197,7 @@ static void
interface_change_config(struct interface *if_old, struct interface *if_new)
{
struct blob_attr *old_config = if_old->config;
- bool reload = false, reload_ip = false;
+ bool reload = false, reload_ip = false, update_prefix_delegation = false;
#define FIELD_CHANGED_STR(field) \
((!!if_old->field != !!if_new->field) || \
@@ -1247,6 +1247,11 @@ interface_change_config(struct interface *if_old, struct interface *if_new)
if_old->force_link = if_new->force_link;
if_old->dns_metric = if_new->dns_metric;
+ if (if_old->proto_ip.no_delegation != if_new->proto_ip.no_delegation) {
+ if_old->proto_ip.no_delegation = if_new->proto_ip.no_delegation;
+ update_prefix_delegation = true;
+ }
+
if_old->proto_ip.no_dns = if_new->proto_ip.no_dns;
interface_replace_dns(&if_old->config_ip, &if_new->config_ip);
@@ -1276,6 +1281,9 @@ interface_change_config(struct interface *if_old, struct interface *if_new)
interface_ip_set_enabled(&if_old->config_ip, config_ip_enabled);
}
+ if (update_prefix_delegation)
+ interface_update_prefix_delegation(&if_old->proto_ip);
+
interface_write_resolv_conf();
if (if_old->main_dev.dev)
interface_check_state(if_old);