From nobody Mon Aug 08 16:36:55 2022 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 4M1hgC5RhMz4YSwm; Mon, 8 Aug 2022 16:36:55 +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 4M1hgC4x0Sz3KJ3; Mon, 8 Aug 2022 16:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659976615; 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=v09y0wFrnOzdG5jiugDgMSstjWmpLHI1NK9/VWr9+I0=; b=NqQWeaP7aaqGHD+iva/Y3y89coPT+9cfp+Rip4nHv6WQ/Aim8E4oZse/tx9tOZ8BPBY7UG Ya06DyjS1BUdIRXYAYie6KCSH5M9axJ2uApbCeyVIhBRbTamYF5rMo6hLSiQ+g1+GZGHKZ Dyl/ZnWIor9ybvzMazvq0Ee5G/PNqr5V5kRXF36M7j1zZdKQONkZQaecPEj808t7fky9M+ XaC9OtHlxMlc+oULWmeNNgZaFNcFxlL4d4374CLF+vOIW2wToHHaazPJ+/z7A/zzsXHN0I vRHzRxTz47eOIl+FK0fnOVIlQ59nAc2vfQ/knoaic3lugKB6XyQjn39R5yoMjg== 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 4M1hgC3zN8zyLg; Mon, 8 Aug 2022 16:36:55 +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 278GatgM092045; Mon, 8 Aug 2022 16:36:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 278Gatkr092044; Mon, 8 Aug 2022 16:36:55 GMT (envelope-from git) Date: Mon, 8 Aug 2022 16:36:55 GMT Message-Id: <202208081636.278Gatkr092044@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: 28b64169eace - main - pf: stop resolving hosts as dns that use ":" modifier 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: 28b64169eace3477abbd50c18163d37c45cf273a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659976615; 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=v09y0wFrnOzdG5jiugDgMSstjWmpLHI1NK9/VWr9+I0=; b=u4dcowNHxG0Q3ggYc6Cadchi59yF5NlzRfII5I2CmdErZLz6OGdyKinEoBF4srmY6xven7 vgblrzMBA857m+LKUqO9w87ZUcAL0JA6Eq0kvG+9K/BeqG+dKUsto8KMmGw9Ech0s0kK8C xSJzkUnTiEGU/u4Ny/CauewnCzcQNkpGJIAimTt7ejwqfG6UoQeYA9ZzyWptjFXQF190ku OGCnzm5l7l0wgTwb7v1hxoequi82S9s+b6IE8WSHMoRsdU2QSjQsGw5AqaGr2zFEi8OHgl weNheSnj3+3j/EFhuanwpE2+sU90Q2CGcHMNwKJjwW8+vfFRVKmIrbTrfo3HUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659976615; a=rsa-sha256; cv=none; b=iVL48fmDs1ir7DLWe/zTYgcZ8W7EqovqPU9eoOLaYaS0TE1IS7DKSR0YinuoVW7umhcFTc ENgaUeyTkpqDmuOUDt5/Jw5ilc5+EfitiUG2y+yajOcun9QAE6scyxZre9kFBsFy+fC94J +dEzAgHvIfXKgxeM/Fslm0qiISgMbRCGyoekOGHyPkTyHNXJAqOrqNHIEmHFxF3Unb2fcd RqhAjJSauDEyoOcKD46sGBihh1jmWSZmMub4ZFoOcbOkyjsPuIlxrV3l2Ulk6sO/1r3ZE6 jUFBdrxpgCMqLk0p1/dga5sygbU8HAFX9xKb6jSeD0F5OLDtr/kusG1KIjGziQ== 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=28b64169eace3477abbd50c18163d37c45cf273a commit 28b64169eace3477abbd50c18163d37c45cf273a Author: Franco Fichtner AuthorDate: 2022-08-08 16:31:02 +0000 Commit: Kristof Provost CommitDate: 2022-08-08 16:31:52 +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 --- 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 a05683f0cbce..c65fe6abe3f6 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); @@ -1695,7 +1695,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 */ @@ -1711,7 +1711,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; @@ -1733,6 +1733,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");