Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/npf/npfctl npfctl: take into account all addresses ...



details:   https://anonhg.NetBSD.org/src/rev/ce0f87e80bd0
branches:  trunk
changeset: 793503:ce0f87e80bd0
user:      rmind <rmind%NetBSD.org@localhost>
date:      Mon Feb 17 00:45:24 2014 +0000

description:
npfctl: take into account all addresses when multiple interfaces are
specified in a set of elements.

diffstat:

 usr.sbin/npf/npfctl/npf_parse.y |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r dd0256ae6646 -r ce0f87e80bd0 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);



Home | Main Index | Thread Index | Old Index