From nobody Tue Oct 28 01:59:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cwYT73xQDz6G4Zy; Tue, 28 Oct 2025 01:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cwYT73QW8z3V1R; Tue, 28 Oct 2025 01:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761616747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=paU5mzAWGlVyOoIKJ67+PdGk+do5r7zrTcYdJd5dgCE=; b=JqXYPaPaK9tcjl+X+MYSv5xCaBEwk+iZRn5u3nkKA+VduvoLbvIVfihTthaJfWtR+GKqJ+ ABPrrSwAa4K3xPuXEJGsc817xBwQaWCOSM3ff01TYMrjLhFWpGqtcH6K2reHWCt9lefeN4 4F8+aff2FE/AbaDM/Q0UuyMheOVM4BPhfpwuiB5C7ljoZ0dTIVf/3EvqvkDphzPqHfK0kF cDeQX1/pqRMVI49UxJrgjyV/hIgdaavE7+UDkTzSyrZXG/zWLqWN3qvQA6WVL5s+O3v5wv eHjTGlCK2h8o1Gj0VwoxfIcYucdm8TplMxmFi5ciDKozVLn9E6R4IwZDlwnV4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761616747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=paU5mzAWGlVyOoIKJ67+PdGk+do5r7zrTcYdJd5dgCE=; b=SeQ1os18R66uKNLS3szlBJKGJ3C5e9soqeE67HzEyTuND03wVbmx6SNcBD2fh89SKGoU93 RaAPN7Z+IHZ96XgW2t0bOqY/QS/QKKhbQ2VCsFAhBrq8RVuL1Mrs9TVsZcoykREiWzp/U0 fvDfRPDiccQdOX8q03RldcwbGEdGrPSDFelhaNTTrQPKLUeMOT3nzOKNtEPP0ve6XHYULX CI6PAZWunwaYgVcYjiDKsjmnYBG6sXoemdBuQzfzB6GsAmJQPctylh+RJ9iy25+MOBEMb+ TwNIK7u2mi2ruijNVKh1bD6xy8iqvrirzM60/7HdNwYsVADICnjrxvGFqaSHXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761616747; a=rsa-sha256; cv=none; b=Dn8qoatuEPG2L9ftrLvKEcZ7R52xJ3RT+0KRQtQlis796dlhh1v6fHRi5gorm58llV51vN cn8i6rUpsGhB9zFYOqEf2u2wUH3zmnUw34lZrJAFFD1w0FYnxc1iR6ZvxIGkWcyvwVSwSJ bqjSZpOjiE4rNrzLd+M+xEiMe73Kg//GiKqpUUkbv7N1kDVUycXJx2YbM4IG6mGUX1btZ3 5v3eYKDBn87/5x7rP+sq0puFF541rmfMQJzmnARNT7iCWRtOmE6IflF+svluiiroFRDLYo bRWcgAGflCzSZFGwhKBJABgfJK+EehEaGbMlkUEWBMhln8PFXa/5EnvCrZwKRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cwYT72kPmzTbq; Tue, 28 Oct 2025 01:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59S1x7VZ071637; Tue, 28 Oct 2025 01:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59S1x78I071634; Tue, 28 Oct 2025 01:59:07 GMT (envelope-from git) Date: Tue, 28 Oct 2025 01:59:07 GMT Message-Id: <202510280159.59S1x78I071634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 9c148488a0f1 - releng/15.0 - UDP: let udp_pcblist() support UDP and UDP-Lite List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 9c148488a0f15b440d0992bc3e01430f69c1e44e Auto-Submitted: auto-generated The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=9c148488a0f15b440d0992bc3e01430f69c1e44e commit 9c148488a0f15b440d0992bc3e01430f69c1e44e Author: Michael Tuexen AuthorDate: 2025-10-20 21:21:47 +0000 Commit: Colin Percival CommitDate: 2025-10-28 01:58:05 +0000 UDP: let udp_pcblist() support UDP and UDP-Lite Provide the IPPROTO_UDP in the arg2 parameter of udp_pcblist() and use this to determine the inpcbinfo. This allows the same function to be used in an upcoming commit to provide the list of pcbs for UDP-Lite just by providing IPPROTO_UDPLITE in the arg2 parameter. Approved by: re (cperciva) Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D53218 (cherry picked from commit be3c59ff508204dbab9e3616dc82ed7620f05d0c) (cherry picked from commit 365378184a46e2bcb30631c216a779df2ab8517a) --- sys/netinet/udp_usrreq.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index cea8a916679b..0a89d91dfc37 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -787,7 +787,8 @@ udplite_ctlinput(struct icmp *icmp) static int udp_pcblist(SYSCTL_HANDLER_ARGS) { - struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_udbinfo, + struct inpcbinfo *pcbinfo = udp_get_inpcbinfo(arg2); + struct inpcb_iterator inpi = INP_ALL_ITERATOR(pcbinfo, INPLOOKUP_RLOCKPCB); struct xinpgen xig; struct inpcb *inp; @@ -799,7 +800,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) if (req->oldptr == 0) { int n; - n = V_udbinfo.ipi_count; + n = pcbinfo->ipi_count; n += imax(n / 8, 10); req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); @@ -810,8 +811,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; - xig.xig_count = V_udbinfo.ipi_count; - xig.xig_gen = V_udbinfo.ipi_gencnt; + xig.xig_count = pcbinfo->ipi_count; + xig.xig_gen = pcbinfo->ipi_gencnt; xig.xig_sogen = so_gencnt; error = SYSCTL_OUT(req, &xig, sizeof xig); if (error) @@ -838,9 +839,9 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) * that something happened while we were processing this * request, and it might be necessary to retry. */ - xig.xig_gen = V_udbinfo.ipi_gencnt; + xig.xig_gen = pcbinfo->ipi_gencnt; xig.xig_sogen = so_gencnt; - xig.xig_count = V_udbinfo.ipi_count; + xig.xig_count = pcbinfo->ipi_count; error = SYSCTL_OUT(req, &xig, sizeof xig); } @@ -848,7 +849,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, - CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, IPPROTO_UDP, udp_pcblist, "S,xinpcb", "List of active UDP sockets");