summaryrefslogtreecommitdiffhomepage
path: root/interface-ip.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-09-12 11:50:03 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-09-12 11:50:03 +0200
commit58d2488ffe9553b908d3e10826376adeeb55d67b (patch)
tree33db179e71bb6b07f2c49452e92ef148a633c918 /interface-ip.c
parent3bd56db589071948eebd30b00cda7ef1fb38a61b (diff)
add support for externally managed ip addresses and routes
Diffstat (limited to 'interface-ip.c')
-rw-r--r--interface-ip.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/interface-ip.c b/interface-ip.c
index e651d39..2e2e9d8 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -24,13 +24,15 @@ interface_update_proto_addr(struct vlist_tree *tree,
if (node_old) {
addr = container_of(node_old, struct device_addr, node);
- system_del_address(dev, addr);
+ if (!(addr->flags & DEVADDR_EXTERNAL))
+ system_del_address(dev, addr);
free(addr);
}
if (node_new) {
addr = container_of(node_new, struct device_addr, node);
- system_add_address(dev, addr);
+ if (!(addr->flags & DEVADDR_EXTERNAL))
+ system_add_address(dev, addr);
}
}
@@ -48,13 +50,15 @@ interface_update_proto_route(struct vlist_tree *tree,
if (node_old) {
route = container_of(node_old, struct device_route, node);
- system_del_route(dev, route);
+ if (!(route->flags & DEVADDR_EXTERNAL))
+ system_del_route(dev, route);
free(route);
}
if (node_new) {
route = container_of(node_new, struct device_route, node);
- system_add_route(dev, route);
+ if (!(route->flags & DEVADDR_EXTERNAL))
+ system_add_route(dev, route);
}
}