From nobody Tue Sep 06 11:19:46 2022 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 4MMNFv0ksqz4bYtk; Tue, 6 Sep 2022 11:19:47 +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 4MMNFv0Dxpz3mPB; Tue, 6 Sep 2022 11:19:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662463187; 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=9IOGIble+9ET781hdKjFHcETk9B99/9lE4+TJKvjGHI=; b=gNTxIRWs94c/sKEe7r5MfUEPezn1yk+sTgkmOrwMZKC+c8Lp13BIXiZRtefqWUDYJZ2nn9 eclmpy0ClCrKUbKJLD2S+BIWb+E0NndQ3Q06OckBGvModRKE/smso+LeI+c5TSgTifC1HJ pRVSBy8C39QtgHgh6FrlwzojyFzPVSFhET/HguO8IM052+PL96aem8gkBfadw1lGA2OfdJ FdqRQEgMwioofdHH+LTKEDX7K8dlHyvOXDc8dybbkgmIUpmi4kMBaXAgC+Co9thTrtSjwQ xpdZ9iuSXkTn7B+BXcjLg7sesagPbaVzEjztBS3FXJnetvy7qy0spSOtjMvfgA== 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 4MMNFt6BVjz18P6; Tue, 6 Sep 2022 11:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 286BJk2Q024912; Tue, 6 Sep 2022 11:19:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 286BJkKq024911; Tue, 6 Sep 2022 11:19:46 GMT (envelope-from git) Date: Tue, 6 Sep 2022 11:19:46 GMT Message-Id: <202209061119.286BJkKq024911@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: ed5eb77e1872 - main - pfctl: fix printing anchors 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: ed5eb77e187286028e839dc4f03b12c99e586a00 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662463187; 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=9IOGIble+9ET781hdKjFHcETk9B99/9lE4+TJKvjGHI=; b=mOvlDcX2opRnvmgfBWunOofJLLFXMtXaAm/MZAydlvtKZUlt4ztJgKnPEvaadp1Zd0enWX sM4J4QZ4hycrJjiDe/EG/tmrqH5sMLzGlFVYJg7/+khpJDgk/JXtq9Ly4aEXqMHCRq2YZt dVe+dJfk6HyPOVboCqj/12M34hLplQ/4TvwmPiY80Qs72VziE9cPjLD2evf/k13twc3rkQ F3SKUcE5Bpe0k5gETksy84taWZurbR8wfPPOKuNSZgNpGRWdOBvw3Kec+TA+p7HWncIS5b HiYme+Hq0/aqNfC9UVkAvjzMbeg7wDcJ6mYJt2bDYvrdZgUYc/9caHCM1xEZQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662463187; a=rsa-sha256; cv=none; b=dzXC+J+8G3fUEvB15ABm9a/IDEZH635sXGxvfj0jtrOYFs1jerNlGyaJn99H5x+CD6UPyn 0onzYWjBYsVWkJagpCMZAJBroMBqi74MHJ77tA8xX1CUQl5Jc2/K+MkL7f7iFuDDdtKbx4 Ke6v+1Mr1EHhu4eZBs69Bmwk0rYKKbTxyV2OTDJ9E6FZf8IGwcKFde+A0m7nz8b6AM9NB0 +/YoXkCygFPhZV+A/Y0e1BZztn43pm5dlWC9IIQMSYoVnjrKsixImcA3GguyeV6Mi1xzvt g7Q3iCJPWxRUYTnbv2Ew4hm99w4maRFAfjPgVrPcut+xFBCiq29urHxvmfk04w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ed5eb77e187286028e839dc4f03b12c99e586a00 commit ed5eb77e187286028e839dc4f03b12c99e586a00 Author: Kristof Provost AuthorDate: 2022-08-30 14:32:30 +0000 Commit: Kristof Provost CommitDate: 2022-09-06 08:42:09 +0000 pfctl: fix printing anchors Ensure that we pass the (base) anchorname to the kernel, not the '/*' suffix. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D36415 --- sbin/pfctl/pfctl.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 93d26e53d71d..31499a9a86b0 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1123,13 +1123,11 @@ pfctl_show_eth_rules(int dev, char *path, int opts, enum pfctl_show format, (p == anchor_call || *(--p) == '/')) || (opts & PF_OPT_RECURSE))) { brace++; - if ((p = strrchr(anchor_call, '/')) != - NULL) - p++; - else - p = &anchor_call[0]; - } else - p = &anchor_call[0]; + int aclen = strlen(anchor_call); + if (anchor_call[aclen - 1] == '*') + anchor_call[aclen - 2] = '\0'; + } + p = &anchor_call[0]; if (dotitle) { pfctl_print_title("ETH RULES:"); dotitle = 0;