summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-10-15 20:16:13 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-10-15 20:16:13 +0000
commitea64695a8cdf6e26501cb5c86822e6ca10fa1a5b (patch)
treefe88665a99a3117872d6dba1349a47d7fd67c60f /usr.bin
parent39c705c4b095f3ac37094235f9c8e380bda9f4ee (diff)
the default route is exactly 0.0.0.0/0, and nothing else. stop ignoring
the netmask, do not print a 0.0.0.0/32 route as "default"; it is not. neither is 0.0.0.0/24.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/route.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index eeb44c413fa..cb855d0ecc4 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.64 2004/06/06 16:55:31 cedric Exp $ */
+/* $OpenBSD: route.c,v 1.65 2004/10/15 20:16:12 henning Exp $ */
/* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: route.c,v 1.64 2004/06/06 16:55:31 cedric Exp $";
+static char *rcsid = "$OpenBSD: route.c,v 1.65 2004/10/15 20:16:12 henning Exp $";
#endif
#endif /* not lint */
@@ -204,9 +204,6 @@ pr_family(int af)
case AF_IPX:
afname = "IPX";
break;
- case AF_ISO:
- afname = "ISO";
- break;
case AF_CCITT:
afname = "X.25";
break;
@@ -467,7 +464,8 @@ p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
struct sockaddr_in *msin = (struct sockaddr_in *)mask;
- cp = (sin->sin_addr.s_addr == 0) ? "default" :
+ cp = (sin->sin_addr.s_addr == 0 && mask &&
+ msin->sin_addr.s_addr == 0) ? "default" :
(mask == NULL || msin->sin_addr.s_addr == (in_addr_t)-1 ?
routename(sin->sin_addr.s_addr) :
netname(sin->sin_addr.s_addr, msin->sin_addr.s_addr));