Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Nov 2017 12:27:02 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325850 - head/sbin/pfctl
Message-ID:  <201711151227.vAFCR2im044533@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Wed Nov 15 12:27:02 2017
New Revision: 325850
URL: https://svnweb.freebsd.org/changeset/base/325850

Log:
  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

Modified:
  head/sbin/pfctl/parse.y

Modified: head/sbin/pfctl/parse.y
==============================================================================
--- head/sbin/pfctl/parse.y	Wed Nov 15 12:23:01 2017	(r325849)
+++ head/sbin/pfctl/parse.y	Wed Nov 15 12:27:02 2017	(r325850)
@@ -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;
 		}
 		;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711151227.vAFCR2im044533>