Bug 199873

Summary: netstat -i asterisk output missing
Product: Base System Reporter: jyoung15
Component: binAssignee: Gleb Smirnoff <glebius>
Status: Closed FIXED    
Severity: Affects Some People Keywords: regression
Priority: ---    
Version: 10.1-STABLE   
Hardware: Any   
OS: Any   

Description jyoung15 2015-05-03 03:22:34 UTC
According to netstat(1) for the -i option:

"An asterisk (“*”) after an interface name indicates that the interface is down"

If appears this feature was removed in base r261207:

------------------------------------------------------------------------
r261207 | glebius | 2014-01-27 03:15:21 -0500 (Mon, 27 Jan 2014) | 4 lines

Merged /head:r256510,256512,257376,257469,260052:

  Make 'netstat -i' use getifaddrs(3) instead of kvm(3).

------------------------------------------------------------------------

Please fix or update documentation.
Comment 1 Gleb Smirnoff freebsd_committer freebsd_triage 2015-05-06 13:09:00 UTC
This isn't trivial now when netstat went to libxo. If I restore the functionality as-is, which is quite trivial, then in JSON or XML output the interface name would be mangled.

So, we need asterisk in txt output, but extra field in JSON/XML.
Comment 2 Gleb Smirnoff freebsd_committer freebsd_triage 2015-05-06 16:44:01 UTC
Fixed in head.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-05-06 16:44:22 UTC
A commit references this bug:

Author: glebius
Date: Wed May  6 16:43:45 UTC 2015
New revision: 282559
URL: https://svnweb.freebsd.org/changeset/base/282559

Log:
  Printing interface names:

  o Restore historical behaviour of appending '*' if interface is down,
    and we have enough space to print it (usually we don't). [1]
  o Do not truncate interface names when printing in encoded format.
  o Report interface flags into encoded format.

  PR:		199873 [1]
  Sponsored by:	Nginx, Inc.

Changes:
  head/usr.bin/netstat/if.c