summaryrefslogtreecommitdiffstats
path: root/sbin/route
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2012-12-04 17:12:23 +0000
committerhrs <hrs@FreeBSD.org>2012-12-04 17:12:23 +0000
commitdb5359d69a9ec06842730b8af2a30072a38b5aa1 (patch)
tree0bacd21c19dc243343418c7f98224210dfb97a47 /sbin/route
parent74acd0aa7d7396577a2cb30cb186ea86e8b8e03d (diff)
downloadFreeBSD-src-db5359d69a9ec06842730b8af2a30072a38b5aa1.zip
FreeBSD-src-db5359d69a9ec06842730b8af2a30072a38b5aa1.tar.gz
- Fix LOR in sa6_recoverscope() in rt_msg2()[1].
- Check V_deembed_scopeid before checking if sa_family == AF_INET6. - Fix scope id handing in route(8)[2] and ifconfig(8). Reported by: rpaulo[1], Mateusz Guzik[1], peter[2]
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 107c66f..b63ce63 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1208,6 +1208,16 @@ getaddr(int which, char *str, struct hostent **hpp)
exit(1);
}
memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6));
+#ifdef __KAME__
+ if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) ||
+ IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) ||
+ IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) &&
+ su->sin6.sin6_scope_id) {
+ *(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] =
+ htons(su->sin6.sin6_scope_id);
+ su->sin6.sin6_scope_id = 0;
+ }
+#endif
freeaddrinfo(res);
if (q != NULL)
*q++ = '/';
OpenPOWER on IntegriCloud