From e7135f6114a1146af46f13b6cad03106f78e2e7f Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 23 Oct 2014 11:12:53 +0200 Subject: [PATCH] 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 --- interface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); -- 2.25.1