Bug 256926 - netstat -s -p arp --libxo json|xml|html displays "received packers" instead of "received packets"
Summary: netstat -s -p arp --libxo json|xml|html displays "received packers" instead o...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-01 18:26 UTC by ghuckriede
Modified: 2021-07-02 08:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ghuckriede 2021-07-01 18:26:34 UTC
Typo in arp statistics for libxo.  Here is a fix.

diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 1143c09734e..45c5f05e60b 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1115,7 +1115,7 @@ arp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
            "{N:/ARP request%s received}\n");
        p2(rxreplies, "{:received-replies/%ju} "
            "{N:/ARP repl%s received}\n");
-       p(received, "{:received-packers/%ju} "
+       p(received, "{:received-packets/%ju} "
            "{N:/ARP packet%s received}\n");
        p(dropped, "{:dropped-no-entry/%ju} "
            "{N:/total packet%s dropped due to no ARP entry}\n");

Currently displays...
# netstat -s -p arp --libxo json
{"statistics": {"arp": {"sent-requests":9,"sent-failures":5,"sent-replies":150,"received-requests":409861,"received-replies":13,"received-packers":409874,"dropped-no-entry":0,"entries-timeout":129,"dropped-duplicate-address":0}}}
# netstat -s -p arp --libxo html
<div class="line"><div class="title">arp</div><div class="text">:</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="sent-requests">9</div><div class="text"> </div><div class="note">ARP requests sent</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="sent-failures">5</div><div class="text"> </div><div class="note">ARP requests failed to sent</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="sent-replies">150</div><div class="text"> </div><div class="note">ARP replies sent</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="received-requests">409886</div><div class="text"> </div><div class="note">ARP requests received</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="received-replies">13</div><div class="text"> </div><div class="note">ARP replies received</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="received-packers">409899</div><div class="text"> </div><div class="note">ARP packets received</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="dropped-no-entry">0</div><div class="text"> </div><div class="note">total packets dropped due to no ARP entry</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="entries-timeout">129</div><div class="text"> </div><div class="note">ARP entrys timed out</div></div><div class="line"><div class="text">	</div><div class="data" data-tag="dropped-duplicate-address">0</div><div class="text"> </div><div class="note">Duplicate IPs seen</div></div>
# netstat -s -p arp --libxo xml
<statistics><arp><sent-requests>9</sent-requests><sent-failures>5</sent-failures><sent-replies>150</sent-replies><received-requests>409915</received-requests><received-replies>13</received-replies><received-packers>409928</received-packers><dropped-no-entry>0</dropped-no-entry><entries-timeout>129</entries-timeout><dropped-duplicate-address>0</dropped-duplicate-address></arp>
#
Comment 1 commit-hook freebsd_committer 2021-07-02 06:44:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=c5b8d7b7c14f72a4ad12e610222642c69374dd4a

commit c5b8d7b7c14f72a4ad12e610222642c69374dd4a
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2021-07-02 06:38:42 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2021-07-02 06:42:34 +0000

    netstat: Fix typo

    Correct spelling of "received packers" to "received packets".

    PR:             256926
    Reported by:    ghuckriede@blackberry.com
    MFC after:      3 days

 usr.bin/netstat/inet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 2 Stefan Eßer freebsd_committer 2021-07-02 08:54:15 UTC
Committed - thanks for reporting this issue.