History log of /src/usr.bin/netstat/inet.c (Results 1 – 25 of 750)
Revision Date Author Comments
# faa31fc0 15-Jan-2026 Johan Söllvander <js@FreeBSD.org>

netstat: Remove padding from cc and stack fields

Trim white space padding that gets added libxo fields cc and stack when
using -C and -c.

The padding is only visible if you're using multiple stacks

netstat: Remove padding from cc and stack fields

Trim white space padding that gets added libxo fields cc and stack when
using -C and -c.

The padding is only visible if you're using multiple stacks or
congestion algorithms.

PR: 292262
MFC after: 5 days
Reviewed by: asomers, tuexen
Approved by: asomers (mentor)
Differential Revision: https://reviews.freebsd.org/D54709

show more ...


# 3b6615ec 06-Jan-2026 Alan Somers <asomers@FreeBSD.org>

netstat: fix a segfault with --libxo

Fix a segfault when printing the "protocol" field. The field-format and
encoding-format were expecting different numbers of arguments.

Also, fix the width of t

netstat: fix a segfault with --libxo

Fix a segfault when printing the "protocol" field. The field-format and
encoding-format were expecting different numbers of arguments.

Also, fix the width of the tcp-state field in encoded output.

PR: 292228
Fixes: c2b08c13c20 netstat: add support for UDP-Lite endpoints
MFC after: 1 week
Sponsored by: ConnectWise
Reviewed by: tuexen, js, des
Differential Revision: https://reviews.freebsd.org/D54567

show more ...


# c2b08c13 23-Oct-2025 Michael Tuexen <tuexen@FreeBSD.org>

netstat: add support for UDP-Lite endpoints

With this patch UDP-Lite endpoints are also shown per default.

Reviewed by: Nick Banks
MFC after: 3 days
Differential Revision: https://reviews.freebsd

netstat: add support for UDP-Lite endpoints

With this patch UDP-Lite endpoints are also shown per default.

Reviewed by: Nick Banks
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53252

show more ...


# a0627bc6 01-Sep-2025 Michael Tuexen <tuexen@FreeBSD.org>

netstat: improve output for tcp stats

Put SYN-cookie related counters in its own container and use consistent
indentation for them.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Netflix,

netstat: improve output for tcp stats

Put SYN-cookie related counters in its own container and use consistent
indentation for them.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D52227

show more ...


# 2b068d35 13-Aug-2025 Michael Tuexen <tuexen@FreeBSD.org>

netstat: report undelivered multi and broadcast UDP packets correctly

When reporting undelivered broadcast/multicast datagrams, don't just
report the undelivered broadcast ones. Actually report the

netstat: report undelivered multi and broadcast UDP packets correctly

When reporting undelivered broadcast/multicast datagrams, don't just
report the undelivered broadcast ones. Actually report the sum of both.
Alternatively, one could also report broadcast and multicast datagrams
separately, but that would change the output format of netstat.
While there, use the correct type for casting a variable printed
with %ju.

Reviewed by: cc
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D51881

show more ...


# 6bca8284 12-Aug-2025 Michael Tuexen <tuexen@FreeBSD.org>

netstat: remove unneeded cast

delivered is already an uint64_t, so no need to cast it to that
type.

MFC after: 1 week
Sponsored by: Netflix, Inc.


# d3f2d49e 12-Aug-2025 Michael Tuexen <tuexen@FreeBSD.org>

netstat: fix reporting of delivered UDP packets

The counter udps_noport includes udps_noportbcast, so don't subtract
udps_noportbcast twice.

PR: 288680
Reviewed by: rrs
MFC after: 1 week
Sponso

netstat: fix reporting of delivered UDP packets

The counter udps_noport includes udps_noportbcast, so don't subtract
udps_noportbcast twice.

PR: 288680
Reviewed by: rrs
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D51870

show more ...


# 1396e87a 17-Jun-2025 Gleb Smirnoff <glebius@FreeBSD.org>

tcp: count two previously ignored kinds of syncookie failures

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D50899


# 6039cd1b 17-Jun-2025 Michael Tuexen <tuexen@FreeBSD.org>

Don't include netinet/tcp_timer.h when not needed

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D50889


# 4294f794 21-Apr-2025 Michael Tuexen <tuexen@FreeBSD.org>

netstat: fix table header alignment for -x

Add a missing space before R-HIWA to align the table header with
the table contents.

Reviewed by: rrs, cc
MFC after: 3 days
Sponsored by: Netflix, Inc.

netstat: fix table header alignment for -x

Add a missing space before R-HIWA to align the table header with
the table contents.

Reviewed by: rrs, cc
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D49941

show more ...


# fe5a6266 03-Feb-2025 Gleb Smirnoff <glebius@FreeBSD.org>

protosw: this is a kernel only header, put back #ifdef _KERNEL

The uncommented #ifdef _KERNEL originates from 1997 by wollman@ (see
57bf258e3dc9e) with no clear original reason. Since these old tim

protosw: this is a kernel only header, put back #ifdef _KERNEL

The uncommented #ifdef _KERNEL originates from 1997 by wollman@ (see
57bf258e3dc9e) with no clear original reason. Since these old times two
abusers of the header leak were created - libprocstat(3) and netstat(1).
These two already have a lot of _WANT_FOO hacks, so satisfy them with
_WANT_PROTOSW.

While here, cleanup and sort forward declaraions.

show more ...


# 95968ea7 12-Oct-2024 Yan-Hao Wang <yanhaowang@FreeBSD.org>

netstat(1): Complete libxo transition

Reviewed by: des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41427


# 646c28ea 21-Jul-2024 Michael Tuexen <tuexen@FreeBSD.org>

tcp: improve SEG.ACK validation

Implement the improved SEG.ACK validation described in RFC 5961.
In addition to that, also detect ghost ACKs, which are ACKs for data
that has never been sent.
The ad

tcp: improve SEG.ACK validation

Implement the improved SEG.ACK validation described in RFC 5961.
In addition to that, also detect ghost ACKs, which are ACKs for data
that has never been sent.
The additional checks are enabled by default, but can be disabled
by setting the sysctl-variable net.inet.tcp.insecure_ack to a
non-zero value.

PR: 250357
Reviewed by: Peter Lei, rscheff (older version)
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D45894

show more ...


# 2a9aae9e 08-May-2024 Richard Scheffenegger <rscheff@FreeBSD.org>

tcp: add counter to track when SACK loss recovery uses TSO

Add a counter to track how frequently SACK has transmitted
more than one MSS using TSO. Instances when this will be
beneficial is the use o

tcp: add counter to track when SACK loss recovery uses TSO

Add a counter to track how frequently SACK has transmitted
more than one MSS using TSO. Instances when this will be
beneficial is the use of PRR, or when ACK thinning due to
GRO/LRO or ACK discards by the network are present.

Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D45070

show more ...


# 5e3934b1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

R

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a pe

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 8e7c2e14 09-Jun-2023 Richard Scheffenegger <rscheff@FreeBSD.org>

netstat: display c and C flags properly

Restructure c and C flag checks for string length to
work properly. Quickly bypass for non TCP protos too.

Reviewed By: tuexen
Sponsored by: NetApp, Inc.
D

netstat: display c and C flags properly

Restructure c and C flag checks for string length to
work properly. Quickly bypass for non TCP protos too.

Reviewed By: tuexen
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D40480

show more ...


# 8e813d07 20-Apr-2023 Gleb Smirnoff <glebius@FreeBSD.org>

netstat: fix printing of TCP pcbs with -A

This change touches both kernel and netstat(1), but either of the changes
will fix printing pcb addresses with -A.

The thing is that historically netstat(1

netstat: fix printing of TCP pcbs with -A

This change touches both kernel and netstat(1), but either of the changes
will fix printing pcb addresses with -A.

The thing is that historically netstat(1) treated TCP differently, and
printed tcpcb address instead of inpcb address. This is not documented
anywhere! With e68b3792440 these two addresses became the same. It is
highly likely they will be the same for a long time, but it might be they
will start to differ again in a far future. My proposal is to stop
treating TCP differently with netstat(1) and right now is a good opportunity
to do that, since there will be no behavior change at all. The kernel
change to tcp_inptoxtp() will go into stable/14 to make it compatible with
netstat(1) binary from stable/13. We can drop it later, probably together
with in_ppcb pointer from inpcb. The in_ppcb in xinpcb will stay for size
compatibility.

Reviewed by: tuexen, rrs
Differential Revision: https://reviews.freebsd.org/D39736

show more ...


# 1a70101a 10-Nov-2022 Richard Scheffenegger <rscheff@FreeBSD.org>

tcp: account sent/received IP ECN markings independently

Have tcpstats (netstat -s) differentiate between received and sent
ECN-marked packets. Also account for IP ECN bits (on TCP packets)
even whe

tcp: account sent/received IP ECN markings independently

Have tcpstats (netstat -s) differentiate between received and sent
ECN-marked packets. Also account for IP ECN bits (on TCP packets)
even when the tcp session has not negotiated ECN support.

Event: IETF 115 Hackathon
Reviewed By: glebius, tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D37314

show more ...


# 08af8aac 27-Sep-2022 Randall Stewart <rrs@FreeBSD.org>

Tcp progress timeout

Rack has had the ability to timeout connections that just sit idle automatically. This
feature of course is off by default and requires the user set it on (though the socket opt

Tcp progress timeout

Rack has had the ability to timeout connections that just sit idle automatically. This
feature of course is off by default and requires the user set it on (though the socket option
has been missing in tcp_usrreq.c). Lets get the progress timeout fully supported in
the base stack as well as rack.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D36716

show more ...


# 2b1c7217 30-Aug-2022 Gleb Smirnoff <glebius@FreeBSD.org>

divert(4): provide statistics

Instead of incrementing pretty random counters in the IP statistics,
create divert socket statistics structure. Export via netstat(1).

Differential revision: https://

divert(4): provide statistics

Instead of incrementing pretty random counters in the IP statistics,
create divert socket statistics structure. Export via netstat(1).

Differential revision: https://reviews.freebsd.org/D36381

show more ...


# 8624f434 30-Aug-2022 Gleb Smirnoff <glebius@FreeBSD.org>

divert: declare PF_DIVERT domain and stop abusing PF_INET

The divert(4) is not a protocol of IPv4. It is a socket to
intercept packets from ipfw(4) to userland and re-inject them
back. It can dive

divert: declare PF_DIVERT domain and stop abusing PF_INET

The divert(4) is not a protocol of IPv4. It is a socket to
intercept packets from ipfw(4) to userland and re-inject them
back. It can divert and re-inject IPv4 and IPv6 packets today,
but potentially it is not limited to these two protocols. The
IPPROTO_DIVERT does not belong to known IP protocols, it
doesn't even fit into u_char. I guess, the implementation of
divert(4) was done the way it is done basically because it was
easier to do it this way, back when protocols for sockets were
intertwined with IP protocols and domains were statically
compiled in.

Moving divert(4) out of inetsw accomplished two important things:

1) IPDIVERT is getting much closer to be not dependent on INET.
This will be finalized in following changes.
2) Now divert socket no longer aliases with raw IPv4 socket.
Domain/proto selection code won't need a hack for SOCK_RAW and
multiple entries in inetsw implementing different flavors of
raw socket can merge into one without requirement of raw IPv4
being the last member of dom_protosw.

Differential revision: https://reviews.freebsd.org/D36379

show more ...


# d59bc188 27-May-2022 Gleb Smirnoff <glebius@FreeBSD.org>

sockbuf: remove unused mbuf counter and cluster counter

With M_EXTPG mbufs these two counters already do not represent the
reality. As we are moving towards protocol independent socket buffers,
whi

sockbuf: remove unused mbuf counter and cluster counter

With M_EXTPG mbufs these two counters already do not represent the
reality. As we are moving towards protocol independent socket buffers,
which may not even use mbufs at all, the counters become less and less
relevant. The only userland seeing them was 'netstat -x'.

PR: 264181 (exp-run)
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35334

show more ...


# 3f169c54 09-Feb-2022 Richard Scheffenegger <rscheff@FreeBSD.org>

tcp: Add/update AccECN related statistics and numbers

Reserve couters in the tcps struct in preparation
for AccECN, extend the debugging output for TF2
flags, optimize the syncache flags from indivi

tcp: Add/update AccECN related statistics and numbers

Reserve couters in the tcps struct in preparation
for AccECN, extend the debugging output for TF2
flags, optimize the syncache flags from individual
bits to a codepoint for the specifc ECN handshake.

This is in preparation of AccECN.

No functional chance except for extended debug
output capabilities.

Reviewed By: #transport, rrs
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34161

show more ...


12345678910>>...30