diff options
author | rgrimes <rgrimes@FreeBSD.org> | 2000-01-07 19:56:57 +0000 |
---|---|---|
committer | rgrimes <rgrimes@FreeBSD.org> | 2000-01-07 19:56:57 +0000 |
commit | a8dc8fe16142d2835a9666751c0aef3ea3fe6da3 (patch) | |
tree | 7b8adacc352a9ff37abaa9ad636f890895812abc /usr.bin/netstat | |
parent | ef57344e9dbcce738590a46eb719cd2e3dbaa76f (diff) | |
download | FreeBSD-src-a8dc8fe16142d2835a9666751c0aef3ea3fe6da3.zip FreeBSD-src-a8dc8fe16142d2835a9666751c0aef3ea3fe6da3.tar.gz |
Instead of reporting all 0.0.0.0 as ``default'' only report
a true default of 0.0.0.0/0 as default.
Reviewed by: wollman
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/route.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 69fb8e8..90438cb 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -434,8 +434,11 @@ p_sockaddr(sa, mask, flags, width) { register struct sockaddr_in *sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr == INADDR_ANY) - cp = "default"; + if ((sin->sin_addr.s_addr == INADDR_ANY) && + mask && + ntohl(((struct sockaddr_in *)mask)->sin_addr.s_addr) + ==0L) + cp = "default" ; else if (flags & RTF_HOST) cp = routename(sin->sin_addr.s_addr); else if (mask) |