From nobody Fri May 9 22:16:24 2025 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 4ZvNd60kYvz5wCh2; Fri, 09 May 2025 22:16:26 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZvNd50dZ3z3RHK; Fri, 09 May 2025 22:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746828985; 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=1V1KD8xWE2cLtRcw2rDiPIltP5qag0n39RffKmo9PLY=; b=DT5f+XlsCduE5DMVd5sB3EzDnbk5KXzYT5jhO4Sn5Yzd+0rJPqUQT58vUijx7SaraIryyB f9gBftIEg6dPd/An5+T/vmBYfy4ZOduyL21CNOCcfBmbebz1CfH72TPoBvBkASrj7AhzJW rR13ydcq9ABGuykH6I2QpUd0QXxcsGw9eG6Cm17fTPKkwswBnncc6ejUUMH5embImankpa WuxvuY1Zg4mMtlerOJhGDIyQADj2UOxY4Aj9fZJbRX7SaL7TbzjYxK6jw4RHQwFil2mMcj 1IJQYplM21S2hnl8dnM754SvJi47qUqzrQtqdwaBkA3hXPMeRbHA5nUwON33TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746828985; 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=1V1KD8xWE2cLtRcw2rDiPIltP5qag0n39RffKmo9PLY=; b=K300idUOlQekFfZ5XSeKnPDxTAKFpV6W50+EY9XWlAVo+eO3e3XBFar9Oif+x4EefWfTD5 t2/o1fvLY62w/0xdyFyR2X0yCqwgcSTTHngxvr2/YB1wZgrygHIbO6zZMoWGV00Bjqnrs5 5iVTdTzMlrw/IOTJglbAxsWSULxxHGZjIBOXOlnWbz3NjEZ3Ihnqr/4kX9KCrfBlpucRzt vgBFHwvSenkJD29OdfOSnoNGvugm5QbZI0Y3Ly7CA8xk4HM2IPweR/AaDoqdWlxtBeqe1C Aj+S1g2c9H3AmorWw2dI0oFdDJGzx/7ZVNwRCI263lyC3U7nsK3FQMHsXYqH8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1746828985; a=rsa-sha256; cv=none; b=G0m8s1G00pfnKAb+m74ERTNzkCOmc85XwIAXJkhRYk8E8EM/ylX2zz2DSzY3zSN6tbvNiQ W/LAUcTRSFl33ShIehksqefe1ESCzeY1tRg0sXTxemel0nB+d/vjlMJc4z8EYQm/vaRhhV aOU6i+N3i0+wssD8H1jugynFvpLViQp3Uh9RVTrvm5xbM6+izhgutigRkF5WYS+G7TTB8p Y5Dzp357OFHAiRgLb4Ua8u64WZXaD9HNrOzUGQCNwtW/5Z5sbrKFP48JTLMxpd5o13NQda xjUvB8C7m+EscJE48RiZHTxTS/Qljzr9A/8qHuZ6gjk7lFD2BMuzLm8rN1WzHw== 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 4ZvNd43PFXz3YQ; Fri, 09 May 2025 22:16:24 +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 549MGO0Z063120; Fri, 9 May 2025 22:16:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 549MGOKC063117; Fri, 9 May 2025 22:16:24 GMT (envelope-from git) Date: Fri, 9 May 2025 22:16:24 GMT Message-Id: <202505092216.549MGOKC063117@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: f5f71f729a5f - main - pfctl: don't require port numbers when killing by key 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: f5f71f729a5fe029fdb029c2bbed35f88d44ab15 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f5f71f729a5fe029fdb029c2bbed35f88d44ab15 commit f5f71f729a5fe029fdb029c2bbed35f88d44ab15 Author: Kristof Provost AuthorDate: 2025-05-09 15:21:18 +0000 Commit: Kristof Provost CommitDate: 2025-05-09 20:49:30 +0000 pfctl: don't require port numbers when killing by key If the port number is zero (e.g. for ICMP echo request states) we don't print it. Accept this when killing states by key. Assume port number 0 if not specified. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index c540a62f0409..94aaaa315639 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1040,8 +1040,9 @@ pfctl_parse_host(char *str, struct pf_rule_addr *addr) } else if ((sbs = strchr(s, ':')) != NULL) { hints.ai_family = AF_INET; *(sbs++) = '\0'; - } else - goto error; + } else { + /* Assume that no ':' means port 0 */ + } if (getaddrinfo(s, sbs, &hints, &ai) != 0) goto error;