aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2015-01-16 11:17:30 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2015-01-16 11:17:30 +0000
commit69c4b56a7425a247a5dfe25a0dcc2918d33f7d6a (patch)
tree073d61ea07cafa55cd5266f46f318ca5f7e702e1
parent0b47e42b496cfd54c9ba835f3d00a555c1d81030 (diff)
downloadsrc-69c4b56a7425a247a5dfe25a0dcc2918d33f7d6a.tar.gz
src-69c4b56a7425a247a5dfe25a0dcc2918d33f7d6a.zip
Eliminate incorrect IPv6 mask guessing:
RFC 2374 concept of 'IPv6 Aggregatable Global Unicast Address Format' was deprecated by RFC 3587 12 years ago. Before: 15:06 [1] edge# netstat -rn6 | grep 2a02:6b8:: 2a02:6b8::/32 2a02:978:2::1 UGS em0 15:06 [1] edge# route -6n get 2a02:6b8:: route: writing to routing socket: No such process After: 15:07 [1] edge# /usr/obj/usr/src/sbin/route/route -n6 get 2a02:6b8:: route to: 2a02:6b8:: destination: 2a02:6b8:: mask: ffff:ffff:: gateway: 2a02:978:2::1 fib: 0 interface: em0 flags: <UP,GATEWAY,DONE,STATIC> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0 MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=277241
-rw-r--r--sbin/route/route.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 53ec2986341a..1bce41ef4298 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1137,19 +1137,11 @@ inet_makenetandmask(u_long net, struct sockaddr_in *sin,
static int
inet6_makenetandmask(struct sockaddr_in6 *sin6, const char *plen)
{
- struct in6_addr in6;
if (plen == NULL) {
if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) &&
- sin6->sin6_scope_id == 0) {
+ sin6->sin6_scope_id == 0)
plen = "0";
- } else if ((sin6->sin6_addr.s6_addr[0] & 0xe0) == 0x20) {
- /* aggregatable global unicast - RFC2374 */
- memset(&in6, 0, sizeof(in6));
- if (!memcmp(&sin6->sin6_addr.s6_addr[8],
- &in6.s6_addr[8], 8))
- plen = "64";
- }
}
if (plen == NULL || strcmp(plen, "128") == 0)