diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2016-02-15 18:59:22 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-02-20 13:28:40 +0100 |
commit | 9c285e43451f3c930bce728ad3c5ac4550679a8e (patch) | |
tree | 0bd65df23640ef4683fe2984bac84d11d69996bf /interface-ip.c | |
parent | 3610a24b218974bdf2d2f709a8af9e4a990c47bd (diff) |
interface-ip: Don't handle external addresses and routes
Prevent external routes and address being added or deleted when changing
the state of the interface ip settings
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'interface-ip.c')
-rw-r--r-- | interface-ip.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |