Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F112553084
D35703.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35703.diff
View Options
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -284,20 +284,20 @@
if (aflag && getifmaddrs(&ifmap) != 0)
err(EX_OSERR, "getifmaddrs");
+ for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+ if (interface != NULL &&
+ strcmp(ifa->ifa_name, interface) != 0)
+ continue;
+ if (af != AF_UNSPEC && ifa->ifa_addr->sa_family != af)
+ continue;
+ ifn_len = strlen(ifa->ifa_name);
+ if ((ifa->ifa_flags & IFF_UP) == 0)
+ ++ifn_len;
+ ifn_len_max = MAX(ifn_len_max, ifn_len);
+ if (ifa->ifa_addr->sa_family == AF_INET6)
+ has_ipv6 = 1;
+ }
if (Wflag) {
- for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
- if (interface != NULL &&
- strcmp(ifa->ifa_name, interface) != 0)
- continue;
- if (af != AF_UNSPEC && ifa->ifa_addr->sa_family != af)
- continue;
- ifn_len = strlen(ifa->ifa_name);
- if ((ifa->ifa_flags & IFF_UP) == 0)
- ++ifn_len;
- ifn_len_max = MAX(ifn_len_max, ifn_len);
- if (ifa->ifa_addr->sa_family == AF_INET6)
- has_ipv6 = 1;
- }
if (has_ipv6) {
net_len = 24;
addr_len = 39;
diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1
--- a/usr.bin/netstat/netstat.1
+++ b/usr.bin/netstat/netstat.1
@@ -309,7 +309,8 @@
See
.Sx GENERAL OPTIONS .
.It Fl W
-Avoid truncating interface names even if this causes some fields to overflow.
+Avoid truncating addresses even if this causes some fields to overflow.
+See
.Sx GENERAL OPTIONS .
.It Fl f Ar protocol_family
Filter by
@@ -795,6 +796,11 @@
.Nm
attempts to resolve addresses and ports,
and display them symbolically.
+.It Fl W
+Wider output; expand address fields, etc, to avoid truncation.
+Non-numeric values such as domain names may still be truncated; use the
+.Fl n
+option if necessary to avoid ambiguity.
.El
.Sh EXAMPLES
Show packet traffic information (packets, bytes, errors, packet drops, etc) for
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 6:33 PM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17233399
Default Alt Text
D35703.diff (1 KB)
Attached To
Mode
D35703: netstat -i: do not truncate interface names
Attached
Detach File
Event Timeline
Log In to Comment