From ea64695a8cdf6e26501cb5c86822e6ca10fa1a5b Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Fri, 15 Oct 2004 20:16:13 +0000 Subject: 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. --- usr.bin/netstat/route.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'usr.bin/netstat/route.c') 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)); -- cgit v1.2.3