diff options
author | Kristof Provost <kp@FreeBSD.org> | 2017-11-15 12:27:02 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2017-11-15 12:27:02 +0000 |
commit | 58c8430a32463db3d29e4c701f2e72653269274c (patch) | |
tree | 0df574d565c6275f4742f0236898e7c261d7408b /sbin | |
parent | c3191c2e2be7cd7d9a25da2f0de1d2e3768c3b0e (diff) | |
download | src-58c8430a32463db3d29e4c701f2e72653269274c.tar.gz src-58c8430a32463db3d29e4c701f2e72653269274c.zip |
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
Notes
Notes:
svn path=/head/; revision=325850
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/parse.y | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 5652845d4195..db09a44ad6b4 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 = $2; } ; |