Summary: | netstat(1) output depends on options order | ||
---|---|---|---|
Product: | Base System | Reporter: | Dmitry Sivachenko <demon> |
Component: | bin | Assignee: | Fernando Apesteguía <fernape> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | fernape, hiren |
Priority: | --- | ||
Version: | 10.1-STABLE | ||
Hardware: | amd64 | ||
OS: | Any |
Description
Dmitry Sivachenko
2015-08-28 09:31:53 UTC
I think it works as expected. '-i' means 'all interfaces' and not 'interval'. You can get data each second for em0 by just 'netstat -I em0 1' When you say 'netstat -i 1....' it'd go and display it for all combined each second. (This is as per my understanding and read of man 1 netstat) Yes, I understands that, the point was that when options are mutually exclusive, an error should be produces instead, and not silently change behaviour. (In reply to Dmitry Sivachenko from comment #2) https://reviews.freebsd.org/D38654 I think this is more a documentation issue. In other commands as rm(1) we can specify too "incompatible" options like -f and -i, but the manual page clearly specifies that the one that appears last in the command line overrides the previous incompatible one: $ touch test_file fernape@hammer:~/test$ rm -f -i test_file remove test_file? y $ touch test_file $ rm -i -f test_file $ A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=91706f0d6d972c3ff359565e144828dad2a790af commit 91706f0d6d972c3ff359565e144828dad2a790af Author: Fernando Apesteguía <fernape@FreeBSD.org> AuthorDate: 2023-02-18 17:00:29 +0000 Commit: Fernando Apesteguía <fernape@FreeBSD.org> CommitDate: 2023-02-18 17:01:34 +0000 netstat.1: Clarify -i and -I priorities netstat(1) allows to specify both -i (all interfaces) and -I <ifname>. However, when both are specified, -I always overrides -i. Add a comment where appropriate the same way we do in rm(1) for -f and -i. PR: 202708 Reported by: demon@ Approved by: manpages (pauamma@) Differential Revision: https://reviews.freebsd.org/D38654 usr.bin/netstat/netstat.1 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) |