From nobody Mon Nov 27 20:38:05 2023 X-Original-To: dev-commits-src-main@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 4SfHTp5K0nz52m7d; Mon, 27 Nov 2023 20:38:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SfHTn5RTqz4LGF; Mon, 27 Nov 2023 20:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701117485; 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=z9YIa/YMJqt+Qnxz7sBUo/K/Uiu7lTbUKKFSiPxShB4=; b=c6Nci8VPQgi+XQS9FuLCJdKy7YaExe+hhmeKZXcVSbSUimtDmL0BiQLsUtIoBIC/Knbh6B xyaxQfAW/WqgIeRFpq+Ilry4RN2Z5QVgIcijZM4R5N2Ko5zMRU35aSg5YadM4G/iDLktUf oGSuba+aTMAbyWwVAsym9eKY/cqYfVyC/YFw89gSkJFT0hbpSJmy2dA4PIbAA820bmoCec /5ZxRIxBJV/jbd81pkGaFExzlDo/gW4Ms9zuv0uDNVBz/MXb/12JaN0TY3SnytZ8GEQhgG e8INnIwN4kxu9pVuBVeg5GihEAMZEFNCqcsOtt8iBAoKDo1sEaYrHsnh+4cXOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701117485; 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=z9YIa/YMJqt+Qnxz7sBUo/K/Uiu7lTbUKKFSiPxShB4=; b=JofFovwL8rVGREFYR9azy+UsL5ttpsozNK6UIL6khKsQVyCmzHGDZ7m/a+UKmQZ/czIWaw zeFrEL6vHMWb56u8VHq06evuN1HWbrhei39cjQxw7URcRDLCiN8kB94lYJzdkG2xazocir VVaqjLpuvbFKiLihJvuKESwCdDEFqSSCzchgf76a5hZ6MPXyvzZjKCD3CBq6M2LjwsIAoW x5vvCAXxPwzlcdz3skt/Oa8G1aPW+1pYKuXgQk/liPBSLiEMVH+ewdtov8J1KP/lSPLLkl vsIW4cB4Vc2W4Q5MQyxVL7dcM3mUaUTEGXXImb7uXncDm4gmfqbntksir7PKzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701117485; a=rsa-sha256; cv=none; b=EtWia5zQwVC0q8HxTJ0ERoxV6NRV644jOAstkGM2OlTmhykn8y6c+q9irDzuPwYqWYm/aE GRB6t9YPldLCp6JcyKt9UnYm6JxPHq1QX5v9hSdCWNeW36eLFTb3cRLFPW1bdQwcmQqiTb VQuo2Sj23oZrV0nPX35ZDEdHCo6q7LnctQ4793ep1+SE5YZ6yKOosavI7Y1lSV+86D6mwQ AOZqZx9jjxwWUUNlhrdU8/INZSriP4zITyxtotVgxlCTExwpJEIM/NIWRFmnLKGRro65Tp Ldj9h4QbMC7W/MXsMEdFdprS+JPNWi+rjDHREvx6jF10MPXJnJKLmMSJQl+pHQ== 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 4SfHTn4QHpzt1D; Mon, 27 Nov 2023 20:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3ARKc5gA020060; Mon, 27 Nov 2023 20:38:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ARKc5s0020057; Mon, 27 Nov 2023 20:38:05 GMT (envelope-from git) Date: Mon, 27 Nov 2023 20:38:05 GMT Message-Id: <202311272038.3ARKc5s0020057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 0187875a6c0b - main - pfctl: Fix recursive printing of anchor labels List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0187875a6c0b68a8026be174f8a0f968fc8ab6ed Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0187875a6c0b68a8026be174f8a0f968fc8ab6ed commit 0187875a6c0b68a8026be174f8a0f968fc8ab6ed Author: Luiz Amaral AuthorDate: 2023-11-27 15:53:27 +0000 Commit: Kristof Provost CommitDate: 2023-11-27 20:37:33 +0000 pfctl: Fix recursive printing of anchor labels We recently noticed that the recursive printing of labels wasn't working like the recursive printing of rules. When running pfctl -sr -a* we get a listing of all rules, including the ones inside anchors. On the other hand, when running pfctl -sl -a*, it would only print the labels in the root level, just like without the -a* argument. As in our use-case we are interested on labels only and our labels are unique even between anchors, we didn't add indentation or hierarchy to the printing. Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D42728 --- sbin/pfctl/pfctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index b752d87e63c6..2702c701f9cc 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1367,6 +1367,14 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, (unsigned long long)rule.bytes[1], (uintmax_t)rule.states_tot); } + + if (anchor_call[0] && + (((p = strrchr(anchor_call, '/')) ? + p[1] == '_' : anchor_call[0] == '_') || + opts & PF_OPT_RECURSE)) { + pfctl_show_rules(dev, npath, opts, format, + anchor_call, depth, rule.anchor_wildcard); + } break; } case PFCTL_SHOW_RULES: