summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c
diff options
context:
space:
mode:
authordhill <dhill@openbsd.org>2010-07-14 23:44:41 +0000
committerdhill <dhill@openbsd.org>2010-07-14 23:44:41 +0000
commit55419723b3accb51f83b8bbcf5ad5e281569f779 (patch)
tree9c9c6542b41448b92f1d44d4da99e664741f44d7 /usr.bin/netstat/main.c
parentReturn -1 on error as advertised. (diff)
downloadwireguard-openbsd-55419723b3accb51f83b8bbcf5ad5e281569f779.tar.xz
wireguard-openbsd-55419723b3accb51f83b8bbcf5ad5e281569f779.zip
pass the correct af if not specified.
fixes printing active connections twice. ok claudio@
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r--usr.bin/netstat/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 204e58ce0d3..07803db6911 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.84 2010/06/30 03:32:55 lum Exp $ */
+/* $OpenBSD: main.c,v 1.85 2010/07/14 23:44:41 dhill Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -420,7 +420,7 @@ main(int argc, char *argv[])
break;
if (tp->pr_name == 0)
continue;
- printproto(tp, p->p_name, af);
+ printproto(tp, p->p_name, AF_INET);
}
endprotoent();
}
@@ -430,7 +430,7 @@ main(int argc, char *argv[])
}
if (af == AF_INET6 || af == AF_UNSPEC)
for (tp = ip6protox; tp->pr_name; tp++)
- printproto(tp, tp->pr_name, af);
+ printproto(tp, tp->pr_name, AF_INET6);
if ((af == AF_UNIX || af == AF_UNSPEC) && !sflag)
unixpr(nl[N_UNIXSW].n_value);
if (af == AF_APPLETALK || af == AF_UNSPEC)