summaryrefslogtreecommitdiff
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>2001-10-09 09:21:11 +0000
committerbrian <brian@cvs.openbsd.org>2001-10-09 09:21:11 +0000
commitd963d47a2b48a473532d2093b6f5b9963ef5f11f (patch)
tree90e7d9271faf3046cc500726de9017a6c048871a /usr.bin/netstat
parentd9a1d14c57e7e2388b1c6f28b7ee4fbe2fed58e3 (diff)
Don't assume that the RTF_HOST flag implies that a netmask is available.
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/route.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 4952d7f76f5..9cd2661aa1e 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.41 2001/08/18 22:14:03 brian Exp $ */
+/* $OpenBSD: route.c,v 1.42 2001/10/09 09:21:10 brian Exp $ */
/* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: route.c,v 1.41 2001/08/18 22:14:03 brian Exp $";
+static char *rcsid = "$OpenBSD: route.c,v 1.42 2001/10/09 09:21:10 brian Exp $";
#endif
#endif /* not lint */
@@ -441,7 +441,7 @@ p_sockaddr(sa, mask, flags, width)
register struct sockaddr_in *msin = (struct sockaddr_in *)mask;
cp = (sin->sin_addr.s_addr == 0) ? "default" :
- ((flags & RTF_HOST) ?
+ ((flags & RTF_HOST) || mask == NULL ?
routename(sin->sin_addr.s_addr) :
netname(sin->sin_addr.s_addr, msin->sin_addr.s_addr));