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
MFC after:	2 weeks
This commit is contained in:
Kristof Provost 2017-11-15 12:27:02 +00:00
parent c3191c2e2b
commit 58c8430a32
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325850

View File

@ -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 = $2;
}
;