[Bug 223208] [pf] pf.conf syntax (:peer) rules load incorrectly

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Nov 14 08:36:55 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223208

--- Comment #11 from Kristof Provost <kp at freebsd.org> ---
(In reply to Kristof Provost from comment #10)
Can you try this one instead?

diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 5652845d419..64015c7894b 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -4390,8 +4390,11 @@ route_host       : STRING                        {
                        $$->tail = $$;
                }
                | '(' STRING host ')'           {
+                       struct node_host *n;
+
                        $$ = $3;
-                       $$->ifname = $2;
+                       for (n = $3; n != NULL; n = n->next)
+                               n->ifname = strdup($2);
                }
                ;


The route_host parsing code set the interface name, but only for the first
node_host in the list. If that one happened to be the inet6 address (given an
inet rule) it'd get removed by remove_invalid_hosts() later on, and we'd have
no interface name.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-pf mailing list