summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-05-20 23:06:28 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-05-20 23:06:28 +0000
commit1c6d6f81973745cbc85a424ec5f1931f07e8ebf7 (patch)
treeddaa2ea98480522c8c22b093a03c8850468b91ad /sbin
parent4c149cc6b4e6efddbf1a82ab305dea5f6eef3f7c (diff)
raise RTF_HOST for IPv6 /128 destination. from ume
Diffstat (limited to 'sbin')
-rw-r--r--sbin/route/route.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index f4d79899389..b1df9d868b8 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.44 2002/02/16 21:27:37 millert Exp $ */
+/* $OpenBSD: route.c,v 1.45 2002/05/20 23:06:27 itojun Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: route.c,v 1.44 2002/02/16 21:27:37 millert Exp $";
+static char rcsid[] = "$OpenBSD: route.c,v 1.45 2002/05/20 23:06:27 itojun Exp $";
#endif
#endif /* not lint */
@@ -115,6 +115,9 @@ void pmsg_common(struct rt_msghdr *);
void pmsg_addrs(char *, int);
void bprintf(FILE *, int, u_char *);
void mask_addr(void);
+#ifdef INET6
+static int inet6_makenetandmask(struct sockaddr_in6 *);
+#endif
int getaddr(int, char *, struct hostent **);
int rtmsg(int, int);
int x25_makemask(void);
@@ -897,7 +900,7 @@ inet_makenetandmask(net, sin, bits)
/*
* XXX the function may need more improvement...
*/
-static void
+static int
inet6_makenetandmask(sin6)
struct sockaddr_in6 *sin6;
{
@@ -918,8 +921,10 @@ inet6_makenetandmask(sin6)
if (plen) {
rtm_addrs |= RTA_NETMASK;
- prefixlen(plen);
+ return prefixlen(plen);
}
+
+ return -1;
}
#endif
@@ -1015,9 +1020,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) == 128)
+ return (1);
return (0);
}
#endif