npfctl: take into account all addresses when multiple interfaces are trunk
authorrmind <rmind@NetBSD.org>
Mon, 17 Feb 2014 00:45:24 +0000
branchtrunk
changeset 224608 8067ba6ea380
parent 224607 44b4ea8603b9
child 224609 a7ec2f9ad054
npfctl: take into account all addresses when multiple interfaces are specified in a set of elements.
usr.sbin/npf/npfctl/npf_parse.y
--- a/usr.sbin/npf/npfctl/npf_parse.y	Sun Feb 16 22:10:40 2014 +0000
+++ b/usr.sbin/npf/npfctl/npf_parse.y	Mon Feb 17 00:45:24 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_parse.y,v 1.32 2014/02/13 03:34:40 rmind Exp $	*/
+/*	$NetBSD: npf_parse.y,v 1.33 2014/02/17 00:45:24 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2011-2014 The NetBSD Foundation, Inc.
@@ -642,8 +642,11 @@
 			$$ = vp;
 			break;
 		case NPFVAR_INTERFACE:
-			ifna = npfvar_get_data(vp, type, 0);
-			$$ = ifna->ifna_addrs;
+			$$ = NULL;
+			for (u_int i = 0; i < npfvar_get_count(vp); i++) {
+				ifna = npfvar_get_data(vp, type, i);
+				$$ = npfvar_add_elements($$, ifna->ifna_addrs);
+			}
 			break;
 		case -1:
 			yyerror("undefined variable '%s'", $1);