Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Aug 2025 16:10:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 288680] netstat delivered count can be corrupt (negative)
Message-ID:  <bug-288680-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288680

            Bug ID: 288680
           Summary: netstat delivered count can be corrupt (negative)
           Product: Base System
           Version: 13.5-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: mibelanger@qnx.com

The following illustrates the issue:

# netstat -s -p udp  
udp:
        1 datagram received
        0 with incomplete header
        0 with bad data length field
        0 with bad checksum
        0 with no checksum
        1 dropped due to no socket
        1 broadcast/multicast datagram undelivered
        0 dropped due to full socket buffers
        0 not for hashed pcb
        18446744073709551615 delivered
        0 datagrams output
        0 times multicast source filter matched

The delivered count is calculated here:
https://github.com/freebsd/freebsd-src/blob/releng/13.5/usr.bin/netstat/inet.c#L938

The "udps_noport" count already includes the "udps_noportbcast" count.
The "duplicate" subtraction corrupts the "delivered" count.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-288680-227>