[OpenWrt-Devel] [RFC relayd 2/2] relayd: add ipv6 link local support

Michal Kazior michal.kazior at tieto.com
Mon Apr 11 09:14:54 EDT 2016


This patch combined with an corresponding kernel
patch makes it possible to route link-local
addresses which, in practice, means DHCPv6, RA, RS
are now functional.

Signed-off-by: Michal Kazior <michal.kazior at tieto.com>
---
 main.c  |  3 +++
 route.c | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/main.c b/main.c
index e1d1dc997b6f..30906b2df2e9 100644
--- a/main.c
+++ b/main.c
@@ -1341,6 +1341,9 @@ static int usage(const char *progname)
 			"	-P		Disable DHCP options parsing\n"
 			"	-L <ipaddr>	Enable local access using <ipaddr> as source address\n"
 			"	-6		Enable IPv6 support\n"
+#ifdef RTAX_FEATURE_XFACE
+			"IPv6 link-local routing capability is compiled in.\n"
+#endif
 			"\n",
 		progname);
 	return -1;
diff --git a/route.c b/route.c
index fc15e9945aaf..05d8cee18214 100644
--- a/route.c
+++ b/route.c
@@ -191,6 +191,13 @@ rtnl_route_request(struct relayd_interface *rif, struct relayd_host *host,
 			struct rtattr rta;
 			int ifindex;
 		} __packed dev;
+		struct {
+			struct rtattr rta;
+			struct {
+				struct rtattr rta;
+				int val;
+			} __packed features;
+		} __packed metrics;
 		union {
 			struct rtnl_addr4 addr4[3];
 			struct rtnl_addr6 addr6[3];
@@ -209,6 +216,21 @@ rtnl_route_request(struct relayd_interface *rif, struct relayd_host *host,
 			.rta_type = RTA_OIF,
 			.rta_len = sizeof(req.dev),
 		},
+		.metrics = {
+			.rta = {
+				.rta_type = RTA_METRICS,
+				.rta_len = sizeof(req.metrics),
+			},
+			.features = {
+				.rta = {
+					.rta_type = RTAX_FEATURES,
+					.rta_len = sizeof(req.metrics.features),
+				},
+#ifdef RTAX_FEATURE_XFACE
+				.val = RTAX_FEATURE_XFACE,
+#endif
+			},
+		},
 	};
 	int pktlen = sizeof(req) - sizeof(req.addrs);
 	void *addrs = &req.addrs;
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list