summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2006-12-29 10:09:09 +0000
committerclaudio <claudio@openbsd.org>2006-12-29 10:09:09 +0000
commit170b9a06fd53e6c3cff1831cd76809ab63f15c89 (patch)
tree24156586c53058dd192712fd96c5250c2e1cedec
parentRoute warns about a illegal prefixlen when a default inet6 route is present. (diff)
downloadwireguard-openbsd-170b9a06fd53e6c3cff1831cd76809ab63f15c89.tar.xz
wireguard-openbsd-170b9a06fd53e6c3cff1831cd76809ab63f15c89.zip
Netstat has the same issue problem as route when printing a default inet6
route. 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--usr.bin/netstat/show.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c
index ac9f811a08d..0cf2c03ac24 100644
--- a/usr.bin/netstat/show.c
+++ b/usr.bin/netstat/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.3 2006/11/17 01:11:23 itojun Exp $ */
+/* $OpenBSD: show.c,v 1.4 2006/12/29 10:09:09 claudio Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -683,7 +683,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) {