diff options
author | 2006-12-29 10:04:36 +0000 | |
---|---|---|
committer | 2006-12-29 10:04:36 +0000 | |
commit | 849f23e1153257c7e4cf984a864655a9cbb0ac46 (patch) | |
tree | 23d2dde35142f595bb4c380e138fdbbf38b03477 | |
parent | Don't wrap MAC address to newline. (diff) | |
download | wireguard-openbsd-849f23e1153257c7e4cf984a864655a9cbb0ac46.tar.xz wireguard-openbsd-849f23e1153257c7e4cf984a864655a9cbb0ac46.zip |
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@
-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) { |