diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-29 10:04:37 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-29 10:04:37 +0000 |
commit | c8956c8e05f612c123927db30c0de0b4ec707772 (patch) | |
tree | 933a893b1b1242f9163a85dd5f9cca2f9b44466c /sbin/route/show.c | |
parent | 954fff8d374d7db929c01b28e8a693cb411c5cfa (diff) |
Route warns about a illegal prefixlen when a default inet6 route is present.
Need to typecast the sizeof() to int so that the compare works. Having a
negativ lim is OK. Reported by Björn Ketelaars. OK deraadt@
Diffstat (limited to 'sbin/route/show.c')
-rw-r--r-- | sbin/route/show.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c index e65d1661794..f81e603ac6a 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.55 2006/11/17 01:11:23 itojun Exp $ */ +/* $OpenBSD: show.c,v 1.56 2006/12/29 10:04:36 claudio Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -677,7 +677,7 @@ netname6(struct sockaddr_in6 *sa6, struct sockaddr_in6 *mask) masklen = 0; if (mask) { lim = mask->sin6_len - offsetof(struct sockaddr_in6, sin6_addr); - lim = lim < sizeof(struct in6_addr) ? + lim = lim < (int)sizeof(struct in6_addr) ? lim : sizeof(struct in6_addr); for (p = (u_char *)&mask->sin6_addr, i = 0; i < lim; p++) { if (final && *p) { |