diff options
| author | Peter Wemm <peter@FreeBSD.org> | 1996-01-14 23:42:19 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 1996-01-14 23:42:19 +0000 |
| commit | cc63cd566306f0dc5aacaf79e781eabb55cfd1f2 (patch) | |
| tree | b6ae4edd170a8cc58fbf46fa1006027cc54c55b8 /usr.bin/netstat | |
| parent | 05ddff6e303e3257a7ea77f89fe5f04e861d29d4 (diff) | |
Notes
Diffstat (limited to 'usr.bin/netstat')
| -rw-r--r-- | usr.bin/netstat/main.c | 8 | ||||
| -rw-r--r-- | usr.bin/netstat/route.c | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index ed026424f4c2..d51489affbfa 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -364,12 +364,20 @@ main(argc, argv) printf("%s: no stats routine\n", tp->pr_name); exit(0); } +#if 0 /* * Keep file descriptors open to avoid overhead * of open/close on each call to get* routines. */ sethostent(1); setnetent(1); +#else + /* + * This does not make sense any more with DNS being default over + * the files. Doing a setXXXXent(1) causes a tcp connection to be + * used for the queries, which is slower. + */ +#endif if (iflag) { intpr(interval, nl[N_IFNET].n_value); exit(0); diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 82b4eff6a383..0f9d1a5f3ae7 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -36,7 +36,7 @@ static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95"; #endif static const char rcsid[] = - "$Id: route.c,v 1.8 1995/12/05 07:29:15 julian Exp $"; + "$Id: route.c,v 1.9 1996/01/14 23:33:13 peter Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -662,8 +662,8 @@ netname(in, mask) net = i & mask; while ((mask & 1) == 0) mask >>= 1, net >>= 1; - if (!(np = getnetbyaddr(net, AF_INET))) - np = getnetbyaddr(i, AF_INET); + if (!(np = getnetbyaddr(i, AF_INET))) + np = getnetbyaddr(net, AF_INET); if (np) cp = np->n_name; } |
