diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2014-10-23 11:12:53 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-10-24 19:53:26 +0200 |
commit | e7135f6114a1146af46f13b6cad03106f78e2e7f (patch) | |
tree | 96c700478761e49619abd16c133665f865c18f16 | |
parent | fb24913f6de4eb730b4ee4ee4962c2f69e18b641 (diff) |
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 <dedeckeh@gmail.com>
-rw-r--r-- | interface.c | 7 |
1 files 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(); |