From nobody Mon Feb 9 21:48:47 2026 X-Original-To: pf@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 4f8yxq6gJnz6QZj9 for ; Mon, 09 Feb 2026 21:48:47 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f8yxq68qRz3lF6 for ; Mon, 09 Feb 2026 21:48:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770673727; 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: in-reply-to:in-reply-to:references:references; bh=13DfA0nabVpS9781LsQwUpjSgkismUYKKl3jLhgDgeQ=; b=w4B0fsTVz5Wku/s9V2ZyZBp2WjpIVO/Y0A9S7xmv0d83Hjyqc2S2Ov/iCCD1A8jHiEm/hF Bv6iwjLNDK0lPUWh6wzUN+rJc+49G5v0YMelVmtIRgrf3x8o2thUHUl4E8bseFjuojEnoP t2AjBOQSiyMikL/GGbKJN6Dy5gIAoe2eDV4C2b2XFhLcU8OzUAVXXH7LswIEPJMdDmkZ8i 33Se5VlxRAIrDNHfIPGWEKO+hj7U3UG7ioMn+bobsN6OjL63XAfdEX83eS9tOENtN3EJz0 bEcz8HYaPnfdvstu7U6dlE0mAEiU5aoJ21+o+BhXtwVZaEfodlZSqdXbTm63Fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770673727; a=rsa-sha256; cv=none; b=qyr83FmYaqk0msyBVOTv9xNFxyCT31rOnFl/elHFGg3UlNIlZwaEBORWCOM4YjOP0bSbSD STNM1CellCILASV4tMeQxl22R8WbLmvAL3ddKCL2SVhboWlV28K9eeRVcWrwCdGYlZRP+e bvA5aNPWd/2g57qu4nQkLxB5ZIy7lDeQBRdVo4U6aI+1va7BbMP4ifG6atv4+6Jnw6igTZ cG2eDmIGFFiohurQSQFIkvKVUoXq5M3mPaux2kVl3Cnnjkh7PtXW3dNY2O9dlD693b+oJ0 0tLukzJn7sweBtuvovMjDRsTWPqwdpE7sW+xjkWphm7QIBM9j447Xv9nvdqctg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770673727; 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: in-reply-to:in-reply-to:references:references; bh=13DfA0nabVpS9781LsQwUpjSgkismUYKKl3jLhgDgeQ=; b=KisSe1rtdoxBvQlP1rkdlaLf6cDBPCHHw97auPXS3MpW6zPEsAAtYwxfBwahyqzOZI7bYo aFq4yd6Pvz3+J9puukyh5Oq/diBGQCO51gr/H/A2vHuxHYRdxnc5PRSv3IT/f8/hKVys8O 5RPqPNMI3480+F3FrtUKvREI+jAbz5QpftTU/BZC4EtVJ2MdCMjt52q2zbgeAvF3jGtY3r M0enOZWkm0whyq0kYcMdmaV/nu/FGKi+tNCOSggTJHMD9l9B2vrHUx4eZizecgCNYRHYCJ 1U4o8cmj8KnII3HcO0OQlg3ko4f3ar6bRKN9JJztKvODI7ZrdVAhb1fCn0YLTg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4f8yxq5T9szr9b for ; Mon, 09 Feb 2026 21:48:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 619LmlAr036748 for ; Mon, 9 Feb 2026 21:48:47 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 619LmlYs036747 for pf@FreeBSD.org; Mon, 9 Feb 2026 21:48:47 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: pf@FreeBSD.org Subject: [Bug 291763] pfctl: loginterface packet counts for pass/block swapped; byte counts all 0 Date: Mon, 09 Feb 2026 21:48:47 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 15.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: eborisch+FreeBSD@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pf@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Technical discussion and general questions about packet filter (pf) List-Archive: https://lists.freebsd.org/archives/freebsd-pf List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-pf@freebsd.org Sender: owner-freebsd-pf@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D291763 --- Comment #5 from eborisch+FreeBSD@gmail.com --- I think I've pinned this down. pfctl (in pfctl_show_status()) calls pfctl_get_status_h(). [lib/libpfctl/libpfctl.c] pfctl_get_status_h() { hdr =3D snl_create_genl_msg_request(&nw, family_id, PFNL_CMD_GET_STATUS); } which appears to call pf_handle_get_status() [sys/netpfil/pf/pf_nl.c] pf_handle_get_status() { ... nlattr_add_u64_array(nw, PF_GS_PCOUNTERS, 2 * 2 * 2, (uint64_t *)s.pcounter= s); ... } but the s here is pf_status, and in [sys/netpfil/pf/pf.h] struct pf_status { [...] uint64_t pcounters[2][2][3]; [...] } so copying 8 bytes out of s.pcounters (above) in pf_handle_get_status() will end up copying the wrong values. It would seem pf_nl.c should be using something similar to the parsing done= in=20 [sys/netpfil/pf/pf_ioctl.c] pf_getstatus() { ... for (int i =3D 0; i < 2; i++) { for (int j =3D 0; j < 2; j++) { for (int k =3D 0; k < 2; k++) { nvlist_append_number_array(nvl, "pcounter= s", s.pcounters[i][j][k]); } ... } to peel out the first two elements of the last index. --=20 You are receiving this mail because: You are the assignee for the bug.=