diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-03-13 14:56:21 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-03-13 21:07:53 +0100 |
commit | 81ac3bce0157f96fbc31cf6e965eecb170e48c88 (patch) | |
tree | b923f6a717bb5f1fd5959dc0ffc96b40ba46dc32 /interface-ip.c | |
parent | 5cd7215a09ad440f0d1b1d05df8deb403f945898 (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-ip.c')
-rw-r--r-- | interface-ip.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/interface-ip.c b/interface-ip.c index 1a6c28d..83f1dfa 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -1053,6 +1053,20 @@ void interface_refresh_assignments(bool hint) refresh = hint; } +void interface_update_prefix_delegation(struct interface_ip_settings *ip) +{ + struct device_prefix *prefix; + + vlist_for_each_element(&ip->prefix, prefix, node) { + interface_update_prefix_assignments(prefix, !ip->no_delegation); + + if (ip->no_delegation) { + if (prefix->head.next) + list_del(&prefix->head); + } else + list_add(&prefix->head, &prefixes); + } +} static void interface_update_prefix(struct vlist_tree *tree, |