From nobody Thu May 26 14:35:03 2022 X-Original-To: freebsd-pf@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 8A4E71B4C134 for ; Thu, 26 May 2022 14:35:04 +0000 (UTC) (envelope-from stefan+freebsd@stha.de) Received: from deponia.stha.de (deponia.stha.de [IPv6:2001:8d8:1801:133::1]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4L89Sl6MDHz3pnp for ; Thu, 26 May 2022 14:35:03 +0000 (UTC) (envelope-from stefan+freebsd@stha.de) Received: from mta0.stha.lan (unknown [IPv6:fd86:82d7:b2e1:100::11]) by deponia.stha.de (Postfix) with ESMTPS id DC7A42498 for ; Thu, 26 May 2022 14:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stha.de; s=rsa_20220207; h=Content-Type:MIME-Version:Message-ID:Subject:To:Sender:From :Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7sEgg3ELi5KW3j8/X3wWLhVx7aCiXzx44lyOEpQIBKc=; b=EKTwQ6A3GCVBrocEK1U5tsrAQp lt9UnlaK1t7A5pIfZHj7uzHCZvAhoCg3K+/NBMBmTpyrqQDApN97QQA01O1725jWbmW1z1eH4umdy dFslkpXhBQXcCuBIivL/GmZShscKzvxqk0dQzxodRR78cbnbTImdA4G83svGwx4TrI/xc5Uot3/9X MdQEsUC+LRbncjpir5XFZwgcjEeHObc5NmxeSluRsEhbZB6SG8SgdXhRZCpygvAf5tRoi8d7wp/Ab Yn/wtRfRcMj9b9r7a1Pt7clRPFiQWjMA4Ch7mVUjr+vmRkvzRIRjnEdHVUoMjtJ8a4wF443q6gcnj toHxeEBA==; DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=stha.de ; s=ed25519_20220207; h=Content-Type:MIME-Version:Message-ID:Subject:To: Sender:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7sEgg3ELi5KW3j8/X3wWLhVx7aCiXzx44lyOEpQIBKc=; b=WKUux2YvvqxbmWXoLDXkhB0D/E f2M5blnjS+DvRaAV5fUsZ6V6Tdh9Ej2trH2PXA38jxo+QqGObqWSSLBvwtDQ==; Received: from [fd86:82d7:b2e1:100::16] (helo=smtp.stha.de) by mta0.stha.lan with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95 (FreeBSD)) (envelope-from ) id 1nuEZq-0004lj-GZ for freebsd-pf@freebsd.org; Thu, 26 May 2022 14:35:02 +0000 Received: from localhost (localhost [::1]) by smtp.stha.de (Postfix) with ESMTPSA id 5AFAE2659 for ; Thu, 26 May 2022 14:35:02 +0000 (UTC) Date: Thu, 26 May 2022 16:35:03 +0200 From: Stefan Haller To: freebsd-pf@freebsd.org Subject: macros not working (syntax error) - possible bug? Message-ID: List-Id: Technical discussion and general questions about packet filter (pf) List-Archive: https://lists.freebsd.org/archives/freebsd-pf List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pf@freebsd.org X-BeenThere: freebsd-pf@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 4L89Sl6MDHz3pnp X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=stha.de header.s=rsa_20220207 header.b=EKTwQ6A3; dkim=pass header.d=stha.de header.s=ed25519_20220207 header.b=WKUux2Yv; dmarc=pass (policy=none) header.from=stha.de; spf=pass (mx1.freebsd.org: domain of stefan@stha.de designates 2001:8d8:1801:133::1 as permitted sender) smtp.mailfrom=stefan@stha.de X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[stha.de:s=rsa_20220207,stha.de:s=ed25519_20220207]; FREEFALL_USER(0.00)[stefan]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-pf@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DKIM_TRACE(0.00)[stha.de:+]; MID_RHS_MATCH_FROM(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[stha.de,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-pf]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:8560, ipnet:2001:8d8::/32, country:DE]; TAGGED_FROM(0.00)[freebsd]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi, (After asking the same question on freebsd-questions@ I was encouraged to ask here.) When playing around with my pf.conf ruleset I came across the following oddity: If I define a macro in the following way: > foo = "10.0.0.1" > bar = "10.0.1.1" > baz = "{" $foo $bar "}" I can later use the macro $baz inside a filter rule. However, if I store subnets in my macros it does not work. This can easily be verify by having a file containing only the following three lines and using `pfctl -nvf file`: > foo = "10.0.0.0/24" > bar = "10.0.1.0/24" > baz = "{" $foo $bar "}" I get: > /tmp/test:3: syntax error According to the section "macros" in pf.conf(5) the macro definition looks legit. Could this be a bug in FreeBSD? Just wanted to ask the list if I am missing something. I tested it on 13.1-RELEASE and CURRENT, I always get a syntax error. Best regards, Stefan Haller