Bug 254673 - netstat -s --libxo json duplicate "ipsec-statistics" section
Summary: netstat -s --libxo json duplicate "ipsec-statistics" section
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Mateusz Guzik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-31 08:17 UTC by j.vandeville
Modified: 2021-10-05 09:46 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 j.vandeville 2021-03-31 08:17:56 UTC
When using "netstat -s", the command output two sections for IPSec : one for ipv4 ipsec and one for ipv6 ipsec :

ipsec:
        0 inbound packets violated process security policy
        0 inbound packets failed due to insufficient memory
        0 invalid inbound packets
        0 outbound packets violated process security policy
        0 outbound packets with no SA available
        0 outbound packets failed due to insufficient memory
        0 outbound packets with no route available
        0 invalid outbound packets
        0 outbound packets with bundled SAs
        0 spd cache hits
        0 spd cache misses
        0 clusters copied during clone
        0 mbufs inserted during makespace

ipsec6:
        0 inbound packets violated process security policy
        0 inbound packets failed due to insufficient memory
        0 invalid inbound packets
        0 outbound packets violated process security policy
        0 outbound packets with no SA available
        0 outbound packets failed due to insufficient memory
        0 outbound packets with no route available
        0 invalid outbound packets
        0 outbound packets with bundled SAs
        0 spd cache hits
        0 spd cache misses
        0 clusters copied during clone
        0 mbufs inserted during makespace

But when using "netstat -s --libxo json", the command ouput two "ipsec-statistics" sections :

"ipsec-statistics":{
         "dropped-policy-violation":0,
         "dropped-no-memory":0,
         "dropped-invalid":0,
         "discarded-policy-violation":0,
         "discarded-no-sa":0,
         "discarded-no-memory":0,
         "discarded-no-route":0,
         "discarded-invalid":0,
         "send-bundled-sa":0,
         "spdcache-hits":0,
         "spdcache-misses":0,
         "clusters-copied-during-clone":0,
         "mbufs-inserted":0
      },

the second section should be "ipsec6-statistics"
Comment 1 commit-hook freebsd_committer freebsd_triage 2021-10-05 09:45:39 UTC
A commit in branch main references this bug:

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

commit ae4fb190fd4a21649c4562fc6cd81bba4da222a4
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-10-05 09:42:58 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2021-10-05 09:42:58 +0000

    netstat: split ipsec and ipsec6 statistics in libxo

    In particular fixes --libxo json

    PR:             254673
    Reported by:    j.vandeville@gmail.com
    Sponsored by:   Rubicon Communications, LLC ("Netgate")

 usr.bin/netstat/ipsec.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)