summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--interface-ip.c12
-rw-r--r--interface-ip.h11
2 files changed, 15 insertions, 8 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);
}
}
diff --git a/interface-ip.h b/interface-ip.h
index 9266727..bf2cf73 100644
--- a/interface-ip.h
+++ b/interface-ip.h
@@ -3,12 +3,15 @@
enum device_addr_flags {
/* address family for routes and addresses */
- DEVADDR_INET4 = (0 << 0),
- DEVADDR_INET6 = (1 << 0),
- DEVADDR_FAMILY = DEVADDR_INET4 | DEVADDR_INET6,
+ DEVADDR_INET4 = (0 << 0),
+ DEVADDR_INET6 = (1 << 0),
+ DEVADDR_FAMILY = DEVADDR_INET4 | DEVADDR_INET6,
/* device route (no gateway) */
- DEVADDR_DEVICE = (1 << 1),
+ DEVADDR_DEVICE = (1 << 1),
+
+ /* externally added address */
+ DEVADDR_EXTERNAL = (1 << 2),
};
union if_addr {