From ceba78f981eb1476a878daa7d39c251de7d659f5 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Thu, 30 Nov 2017 21:32:28 +0000 Subject: [PATCH] MFC r325850: pfctl: teach route-to to deal with interfaces with multiple addresses 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 and the rule wanted an inet address it'd get removed by remove_invalid_hosts() later on, and we'd have no interface name. We must set the interface name for all node_host entries in the list, not just the first one. PR: 223208 --- sbin/pfctl/parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index e468a38b2c8a..9a931e102abf 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -4310,8 +4310,11 @@ route_host : STRING { $$->tail = $$; } | '(' STRING host ')' { + struct node_host *n; + $$ = $3; - $$->ifname = $2; + for (n = $3; n != NULL; n = n->next) + n->ifname = $2; } ;