From: Hans Dedecker Date: Thu, 23 Oct 2014 09:12:53 +0000 (+0200) Subject: netifd : Reinsert ip parameters (addresses/routes) based on old interface config... X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e7135f6114a1146af46f13b6cad03106f78e2e7f;p=oweals%2Fnetifd.git netifd : Reinsert ip parameters (addresses/routes) based on old interface config state Reinserts the config IP parameters as the config_ip parameter of the new interface is set to false in interface_alloc and thus not loading the config ip options of the old interface Signed-off-by: Hans Dedecker --- diff --git a/interface.c b/interface.c index 4543250..733b5f1 100644 --- a/interface.c +++ b/interface.c @@ -1045,10 +1045,13 @@ interface_change_config(struct interface *if_old, struct interface *if_new) } if (reload_ip) { + bool config_ip_enabled = if_old->config_ip.enabled; + bool proto_ip_enabled = if_old->proto_ip.enabled; + interface_ip_set_enabled(&if_old->config_ip, false); interface_ip_set_enabled(&if_old->proto_ip, false); - interface_ip_set_enabled(&if_old->proto_ip, if_new->proto_ip.enabled); - interface_ip_set_enabled(&if_old->config_ip, if_new->config_ip.enabled); + interface_ip_set_enabled(&if_old->proto_ip, proto_ip_enabled); + interface_ip_set_enabled(&if_old->config_ip, config_ip_enabled); } interface_write_resolv_conf();