[OpenWrt-Devel] [PATCH 1/3] netifd: Reinsert ip parameters

Hans Dedecker dedeckeh at gmail.com
Wed Oct 22 08:11:25 EDT 2014


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 at gmail.com>
---
 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();
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list