[OpenWrt-Devel] [PATCH] interface: add IPv6 addresses without IFA_F_NOPREFIXROUTE

Alin Nastac alin.nastac at gmail.com
Wed Dec 18 05:44:50 EST 2019


When netifd manages the prefix route directly, it will remove it
the moment prefix gets deprecated. This will make it impossible
for the target to send ICMPv6 errors back to LAN devices still
using the deprecated prefix, thus breaking the L-14 requirement
of RFC 7084.

Signed-off-by: Alin Nastac <alin.nastac at gmail.com>
---
 interface-ip.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/interface-ip.c b/interface-ip.c
index c159e09..0958fcb 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -905,20 +905,14 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment,
 	struct device *l3_downlink = iface->l3_dev.dev;
 
 	struct device_addr addr;
-	struct device_route route;
 	memset(&addr, 0, sizeof(addr));
-	memset(&route, 0, sizeof(route));
 
 	addr.addr.in6 = assignment->addr;
 	addr.mask = assignment->length;
-	addr.flags = DEVADDR_INET6 | DEVADDR_OFFLINK;
+	addr.flags = DEVADDR_INET6;
 	addr.preferred_until = prefix->preferred_until;
 	addr.valid_until = prefix->valid_until;
 
-	route.flags = DEVADDR_INET6;
-	route.mask = addr.mask < 64 ? 64 : addr.mask;
-	route.addr = addr.addr;
-
 	if (!add && assignment->enabled) {
 		time_t now = system_get_rtime();
 
@@ -939,10 +933,6 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment,
 							addr.mask, 0, iface, "unreachable", true);
 		}
 
-		clear_if_addr(&route.addr, route.mask);
-		interface_set_route_info(iface, &route);
-
-		system_del_route(l3_downlink, &route);
 		system_add_address(l3_downlink, &addr);
 
 		assignment->addr = in6addr_any;
@@ -955,7 +945,6 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment,
 				return;
 
 			assignment->addr = addr.addr.in6;
-			route.addr = addr.addr;
 		}
 
 		if (system_add_address(l3_downlink, &addr))
@@ -976,11 +965,6 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment,
 			}
 		}
 
-		clear_if_addr(&route.addr, route.mask);
-		interface_set_route_info(iface, &route);
-
-		system_add_route(l3_downlink, &route);
-
 		if (uplink && uplink->l3_dev.dev && !(l3_downlink->settings.flags & DEV_OPT_MTU6)) {
 			int mtu = system_update_ipv6_mtu(uplink->l3_dev.dev, 0);
 			int mtu_old = system_update_ipv6_mtu(l3_downlink, 0);
-- 
2.7.4


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list