git: be93b2748368 - main - UDP-Lite: export pcblist via sysctl interface
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 23 Oct 2025 07:11:58 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=be93b27483680c7e741b1627cc96a131bc99436c
commit be93b27483680c7e741b1627cc96a131bc99436c
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2025-10-23 07:10:03 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-10-23 07:10:03 +0000
UDP-Lite: export pcblist via sysctl interface
Export the list of pcbs for UDP-Lite to be consumed by sockstat and
netstat.
Reviewed by: Peter Lei, Nick Banks
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D53229
---
sys/netinet/in_proto.c | 2 ++
sys/netinet/udp_usrreq.c | 5 +++++
sys/netinet/udp_var.h | 1 +
3 files changed, 8 insertions(+)
diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c
index db46da6022c5..42a6cf0b5810 100644
--- a/sys/netinet/in_proto.c
+++ b/sys/netinet/in_proto.c
@@ -108,6 +108,8 @@ SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"ICMP");
SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"UDP");
+SYSCTL_NODE(_net_inet, IPPROTO_UDPLITE, udplite, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+ "UDP-Lite");
SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"TCP");
#if defined(SCTP) || defined(SCTP_SUPPORT)
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 0a89d91dfc37..04d01099d54a 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -853,6 +853,11 @@ SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist,
udp_pcblist, "S,xinpcb",
"List of active UDP sockets");
+SYSCTL_PROC(_net_inet_udplite, OID_AUTO, pcblist,
+ CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, IPPROTO_UDPLITE,
+ udp_pcblist, "S,xinpcb",
+ "List of active UDP-Lite sockets");
+
#ifdef INET
static int
udp_getcred(SYSCTL_HANDLER_ARGS)
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
index 3895f365db3c..3ae08fc0b8f0 100644
--- a/sys/netinet/udp_var.h
+++ b/sys/netinet/udp_var.h
@@ -147,6 +147,7 @@ void kmod_udpstat_inc(int statnum);
} while (0)
SYSCTL_DECL(_net_inet_udp);
+SYSCTL_DECL(_net_inet_udplite);
VNET_DECLARE(struct inpcbinfo, udbinfo);
VNET_DECLARE(struct inpcbinfo, ulitecbinfo);