summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/main.c8
-rw-r--r--usr.bin/netstat/route.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index ed02642..d51489a 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 82b4eff..0f9d1a5 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;
}
OpenPOWER on IntegriCloud