From nobody Mon Aug 22 07:21:05 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 4MB3gP4CDQz4b4Sd; Mon, 22 Aug 2022 07:21:05 +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 4MB3gP3mcvz3NvK; Mon, 22 Aug 2022 07:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661152865; 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=EdzB4uSlPJirpzLH4daOa03uV+7GhfTLQME7QhNxD6Y=; b=Rabv3aFruSFx2JMkeH0QySU404/8FqrU7qb56qNkN8Nsfo/i9Tl2yMoz6zkoQ9nctvLYT1 v/rJvO8xbgGqzlQFe/aCsIbZ9ZSGFRpQYjbI6BszjQ7AUXAkRKxZ//EVwDK5toAtRUJxP4 P1gm8Y4tOp06vA84T3aGl66LkgPP1Ykf8N3/vc6Q0HaqWfFfQZiPIvWiRVScz8eibboLZ3 JJDzF6/vriWjsYWSPLAO272uk1umOTas27SJ5CBwYcpsF2ELghfsg976zbfnXdVMymn0py 9+cJcwCZgOc0wNkp+0mLPvLveM6wp8IHV1mBjQ5/Bs6yWVBLDEITHb4szVkipQ== 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 4MB3gP2rF2zhnK; Mon, 22 Aug 2022 07:21:05 +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 27M7L5jA088146; Mon, 22 Aug 2022 07:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27M7L57u088145; Mon, 22 Aug 2022 07:21:05 GMT (envelope-from git) Date: Mon, 22 Aug 2022 07:21:05 GMT Message-Id: <202208220721.27M7L57u088145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e337cd72f79e - stable/12 - pf: stop resolving hosts as dns that use ":" modifier 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/stable/12 X-Git-Reftype: branch X-Git-Commit: e337cd72f79e2f64fc9e4672486b9e27e1635b06 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661152865; 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=EdzB4uSlPJirpzLH4daOa03uV+7GhfTLQME7QhNxD6Y=; b=e6TvLuKkgchWLwE06RDFnx/xMEp5lV0gJja+5hMM1Io2BqGf1zScpbvAF8x14psKqGM0rQ DusGmNPfc39AvuXq9cY0noYRdwSoe7u3iQkAUHdDVHg+WXRIsr4X5OKaxzqVlcBndkZH6l iYWJvcB2C//YS57JyGd4cB+RVvQOV+bAqlKmbR+ICcEzsneqTTVmhniQrKBsjvS+WJHcxy fSVOR7oRROzSLRYDFWLDbWbqDPJrMxjsQ247ri+ts8UPJvihAUJEsEbKBBoXz73ITwGm/5 zTcMcxRryjES6ct4mzUPE1WKgubOqYUzwF0X3UFR/L9kZOUaBXJpt/3Ie03c7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661152865; a=rsa-sha256; cv=none; b=a83E8Ya13pD26+aaI00XURsfzMzLdBCfZ4Mx2RypGH+yMV5FSiVYPa2Npc4fWm2TovJVxg YwoaiV8HsB+KPpZb/6L6maloq10pNc+IUPLEwKs27INNSpD/SBCAXjv7NZRpKug3y+Vf28 /SShKCzA1bMLPZMKg7e2se0alFzhy9Ppk99qVdihY4ueUTes8DZ+EZ5qIkt+UsZg63gVNy 0F92XadrN+ZihSYR8X+zM8qz2UV3tpdzdcR6q3+qIcBQl6ElcNGI5d2MbO70M17R2hTH/1 wVy7KiS7/Gqq5Jjnds/9YyWHqa+974bmf30CMoLjhKTRO+XihJZYXOdJZENm9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e337cd72f79e2f64fc9e4672486b9e27e1635b06 commit e337cd72f79e2f64fc9e4672486b9e27e1635b06 Author: Franco Fichtner AuthorDate: 2022-08-08 16:31:02 +0000 Commit: Kristof Provost CommitDate: 2022-08-22 06:55:31 +0000 pf: stop resolving hosts as dns that use ":" modifier When the interface does not exist avoid passing host with special pf modifiers to DNS resolution as they come up empty anyway. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35429 (cherry picked from commit 28b64169eace3477abbd50c18163d37c45cf273a) --- sbin/pfctl/pfctl_parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 3242404954bc..78ad4dbfc717 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -74,7 +74,7 @@ void print_fromto(struct pf_rule_addr *, pf_osfp_t, struct pf_rule_addr *, u_int8_t, u_int8_t, int, int); int ifa_skip_if(const char *filter, struct node_host *p); -struct node_host *host_if(const char *, int); +struct node_host *host_if(const char *, int, int *); struct node_host *host_v4(const char *, int); struct node_host *host_v6(const char *, int); struct node_host *host_dns(const char *, int, int); @@ -1572,7 +1572,7 @@ host(const char *s) /* interface with this name exists? */ /* expensive with thousands of interfaces - prioritze IPv4/6 check */ - if (cont && (h = host_if(ps, mask)) != NULL) + if (cont && (h = host_if(ps, mask, &cont)) != NULL) cont = 0; /* dns lookup */ @@ -1588,7 +1588,7 @@ host(const char *s) } struct node_host * -host_if(const char *s, int mask) +host_if(const char *s, int mask, int *cont) { struct node_host *n, *h = NULL; char *p, *ps; @@ -1610,6 +1610,7 @@ host_if(const char *s, int mask) return (NULL); } *p = '\0'; + *cont = 0; } if (flags & (flags - 1) & PFI_AFLAG_MODEMASK) { /* Yep! */ fprintf(stderr, "illegal combination of interface modifiers\n");