diff options
author | hrs <hrs@FreeBSD.org> | 2012-12-04 17:12:23 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2012-12-04 17:12:23 +0000 |
commit | db5359d69a9ec06842730b8af2a30072a38b5aa1 (patch) | |
tree | 0bacd21c19dc243343418c7f98224210dfb97a47 /sbin | |
parent | 74acd0aa7d7396577a2cb30cb186ea86e8b8e03d (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sbin/ifconfig/af_inet6.c | 5 | ||||
-rw-r--r-- | sbin/route/route.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index a9ad867..5911a94 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -251,8 +251,9 @@ in6_status(int s __unused, const struct ifaddrs *ifa) if ((flags6 & IN6_IFF_TEMPORARY) != 0) printf("temporary "); - if (sin->sin6_scope_id) - printf("scopeid 0x%x ", sin->sin6_scope_id); + if (((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) + printf("scopeid 0x%x ", + ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id); if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) { printf("pltime "); 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++ = '/'; |