summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2002-06-08 19:49:22 +0000
committerume <ume@FreeBSD.org>2002-06-08 19:49:22 +0000
commite752ebdffb48890daf831f6efeeff8195d249903 (patch)
tree0c022bfc042438db96239dc15796dcf00b278482
parent564b5ce4573a9f47bb561cd01270f3fcc1d9497a (diff)
downloadFreeBSD-src-e752ebdffb48890daf831f6efeeff8195d249903.zip
FreeBSD-src-e752ebdffb48890daf831f6efeeff8195d249903.tar.gz
Don't have -prefixlen 128 on host routes.
Obtained from: KAME
-rw-r--r--sbin/route/route.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 55e61a2..2ddc50d 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -884,15 +884,13 @@ inet6_makenetandmask(sin6, plen)
if (!memcmp(&sin6->sin6_addr.s6_addr[8],
&in6.s6_addr[8], 8))
plen = "64";
- else
- plen = "128";
}
}
- if (plen) {
- rtm_addrs |= RTA_NETMASK;
- return prefixlen(plen);
- }
+ if (!plen || strcmp(plen, "128") == 0)
+ return 1;
+ rtm_addrs |= RTA_NETMASK;
+ (void)prefixlen(plen);
return 0;
}
#endif
@@ -1029,8 +1027,7 @@ getaddr(which, s, hpp)
if (q != NULL)
*q++ = '/';
if (which == RTA_DST)
- if (inet6_makenetandmask(&su->sin6, q) == -1)
- return (1);
+ return (inet6_makenetandmask(&su->sin6, q));
return (0);
}
#endif /* INET6 */
OpenPOWER on IntegriCloud