Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 May 2022 16:35:03 +0200
From:      Stefan Haller <stefan+freebsd@stha.de>
To:        freebsd-pf@freebsd.org
Subject:   macros not working (syntax error) - possible bug?
Message-ID:  <Yo%2BQFyMS%2BB%2BMFw7o@stha.de>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Yo%2BQFyMS%2BB%2BMFw7o>