[OpenWrt-Devel] [PATCH netifd] interface-ip : Don't handle external addresses and routes
Hans Dedecker
dedeckeh at gmail.com
Mon Feb 15 12:59:22 EST 2016
Prevent external routes and address being added or deleted when changing
the state of the interface ip settings
Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
interface-ip.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/interface-ip.c b/interface-ip.c
index eb585f5..26a2865 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -1264,6 +1264,9 @@ void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled)
vlist_for_each_element(&ip->addr, addr, node) {
bool v6 = ((addr->flags & DEVADDR_FAMILY) == DEVADDR_INET6) ? true : false;
+ if (addr->flags & DEVADDR_EXTERNAL)
+ continue;
+
if (addr->enabled == enabled)
continue;
@@ -1289,6 +1292,9 @@ void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled)
vlist_for_each_element(&ip->route, route, node) {
bool _enabled = enabled;
+ if (route->flags & DEVADDR_EXTERNAL)
+ continue;
+
if (!enable_route(ip, route))
_enabled = false;
--
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