summaryrefslogtreecommitdiffhomepage
path: root/interface-ip.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2015-05-19 10:58:34 +0200
committerSteven Barth <steven@midlink.org>2015-05-19 10:58:34 +0200
commit8faa5b30b12ee3e4d06a8d2557d1f112f1f2786e (patch)
tree17a13b2a9668f8ef8e00cf017ebe8d5b13c70c09 /interface-ip.c
parent6906beee9df0942fc4e8f27faa8dd3c6ef32cfd7 (diff)
ipv6: use kernel >= 3.14 handling of offlink-addresses
Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat (limited to 'interface-ip.c')
-rw-r--r--interface-ip.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/interface-ip.c b/interface-ip.c
index 1a22ce6..18dd2fa 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -442,6 +442,9 @@ interface_handle_subnet_route(struct interface *iface, struct device_addr *addr,
struct device *dev = iface->l3_dev.dev;
struct device_route route;
+ if (addr->flags & DEVADDR_OFFLINK)
+ return;
+
memset(&route, 0, sizeof(route));
route.iface = iface;
route.flags = addr->flags;
@@ -453,14 +456,11 @@ interface_handle_subnet_route(struct interface *iface, struct device_addr *addr,
route.flags |= DEVADDR_KERNEL;
system_del_route(dev, &route);
- if (!(addr->flags & DEVADDR_OFFLINK)) {
- route.flags &= ~DEVADDR_KERNEL;
- route.metric = iface->metric;
- system_add_route(dev, &route);
- }
+ route.flags &= ~DEVADDR_KERNEL;
+ route.metric = iface->metric;
+ system_add_route(dev, &route);
} else {
- if (!(addr->flags & DEVADDR_OFFLINK))
- system_del_route(dev, &route);
+ system_del_route(dev, &route);
}
}
@@ -562,7 +562,7 @@ interface_update_proto_addr(struct vlist_tree *tree,
}
}
- if ((a_new->flags & DEVADDR_OFFLINK) || iface->metric)
+ if (iface->metric)
interface_handle_subnet_route(iface, a_new, true);
}
}
@@ -1228,7 +1228,7 @@ void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled)
if (enabled) {
system_add_address(dev, addr);
- if ((addr->flags & DEVADDR_OFFLINK) || iface->metric)
+ if (iface->metric)
interface_handle_subnet_route(iface, addr, true);
} else {
interface_handle_subnet_route(iface, addr, false);