Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/netstat Use sysctl for interface printing (-i), leav...



details:   https://anonhg.NetBSD.org/src/rev/e1c85c39bfef
branches:  trunk
changeset: 346457:e1c85c39bfef
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 13 21:57:01 2016 +0000

description:
Use sysctl for interface printing (-i), leave on for multicast address printing
(-ia) and comment in the code where this is missing?
XXX: should that be an ioctl or sysctl? provide getifmultiaddrs() via the
routing socket? I guess since this is just for netstat a simple sysctl or
ioctl would suffice. I lean towards sysctl.

diffstat:

 usr.bin/netstat/main.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r d7a53fa9c49a -r e1c85c39bfef usr.bin/netstat/main.c
--- a/usr.bin/netstat/main.c    Wed Jul 13 21:33:28 2016 +0000
+++ b/usr.bin/netstat/main.c    Wed Jul 13 21:57:01 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.95 2014/11/12 03:34:59 christos Exp $       */
+/*     $NetBSD: main.c,v 1.96 2016/07/13 21:57:01 christos Exp $       */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "from: @(#)main.c       8.4 (Berkeley) 3/1/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.95 2014/11/12 03:34:59 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.96 2016/07/13 21:57:01 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -358,7 +358,7 @@
                 */
                use_sysctl = 0;
        } else if (qflag ||
-                  iflag ||
+                  (iflag && aflag) ||  /* For multicast */
 #ifndef SMALL
                   gflag ||
 #endif



Home | Main Index | Thread Index | Old Index