summaryrefslogtreecommitdiffstats
path: root/sbin/route
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-02-23 18:00:33 +0000
committershin <shin@FreeBSD.org>2000-02-23 18:00:33 +0000
commit29d7018ad6aec635cadcb58aa101fff7262a9b63 (patch)
tree401b24f7abcc9d1942566d926a3d368ebdcb4159 /sbin/route
parent8fc7b7d84141f685dba69b0e9575d46e5109241e (diff)
downloadFreeBSD-src-29d7018ad6aec635cadcb58aa101fff7262a9b63.zip
FreeBSD-src-29d7018ad6aec635cadcb58aa101fff7262a9b63.tar.gz
Add an scope index embedded IPv6 link local addr creation support, by route
command. This is a workaround for some kernel interface which can't treat sin6_scope_id, yet.
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 6e67c40..e06017e 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -924,6 +924,10 @@ getaddr(which, s, hpp)
exit(1);
}
bcopy(res->ai_addr, &su->sa, res->ai_addrlen);
+ /* XXX: embedded link local addr check */
+ if (IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr))
+ *(u_short *)&su->sin6.sin6_addr.s6_addr[2] =
+ ntohs(su->sin6.sin6_scope_id);
return 0;
}
#endif
OpenPOWER on IntegriCloud