From 55419723b3accb51f83b8bbcf5ad5e281569f779 Mon Sep 17 00:00:00 2001 From: dhill Date: Wed, 14 Jul 2010 23:44:41 +0000 Subject: [PATCH] pass the correct af if not specified. fixes printing active connections twice. ok claudio@ --- usr.bin/netstat/main.c | 6 +++--- 1 file 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) -- 2.20.1