diff options
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/route.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index 83ec02e..d5eea5b 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -113,6 +113,9 @@ char *atalk_ntoa(struct at_addr); const char *routename(), *netname(); void flushroutes(), newroute(), monitor(), sockaddr(), sodump(), bprintf(); void print_getmsg(), print_rtmsg(), pmsg_common(), pmsg_addrs(), mask_addr(); +#ifdef INET6 +static int inet6_makenetandmask(struct sockaddr_in6 *); +#endif int getaddr(), rtmsg(), x25_makemask(); int prefixlen(); extern char *iso_ntoa(); @@ -863,7 +866,7 @@ inet_makenetandmask(net, sin, bits) /* * XXX the function may need more improvement... */ -static void +static int inet6_makenetandmask(sin6) struct sockaddr_in6 *sin6; { @@ -885,8 +888,9 @@ inet6_makenetandmask(sin6) if (plen) { rtm_addrs |= RTA_NETMASK; - prefixlen(plen); + return prefixlen(plen); } + return 0; } #endif @@ -1011,9 +1015,10 @@ getaddr(which, s, hpp) su->sin6.sin6_scope_id = 0; } #endif - if (which == RTA_DST) - inet6_makenetandmask(&su->sin6); freeaddrinfo(res); + if (which == RTA_DST) + if (inet6_makenetandmask(&su->sin6) == -1) + return (1); return (0); } #endif /* INET6 */ |