Module Name:    src
Committed By:   riz
Date:           Mon Nov 19 18:16:18 UTC 2012

Modified Files:
        src/lib/libnpf [netbsd-6]: npf.c
        src/usr.sbin/npf/npfctl [netbsd-6]: npf_var.h

Log Message:
Pull up following revision(s) (requested by rmind in ticket #653):
        lib/libnpf/npf.c: revision 1.14
        usr.sbin/npf/npfctl/npf_var.h: revision 1.5
Fix for npfctl show case.  Improve some description while here.


To generate a diff of this commit:
cvs rdiff -u -r1.7.2.6 -r1.7.2.7 src/lib/libnpf/npf.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/usr.sbin/npf/npfctl/npf_var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libnpf/npf.c
diff -u src/lib/libnpf/npf.c:1.7.2.6 src/lib/libnpf/npf.c:1.7.2.7
--- src/lib/libnpf/npf.c:1.7.2.6	Sun Nov 18 22:38:25 2012
+++ src/lib/libnpf/npf.c	Mon Nov 19 18:16:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.c,v 1.7.2.6 2012/11/18 22:38:25 riz Exp $	*/
+/*	$NetBSD: npf.c,v 1.7.2.7 2012/11/19 18:16:17 riz Exp $	*/
 
 /*-
  * Copyright (c) 2010-2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.7.2.6 2012/11/18 22:38:25 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.7.2.7 2012/11/19 18:16:17 riz Exp $");
 
 #include <sys/types.h>
 #include <netinet/in_systm.h>
@@ -213,13 +213,11 @@ void
 npf_config_destroy(nl_config_t *ncf)
 {
 
-	if (ncf->ncf_dict == NULL) {
+	if (!ncf->ncf_dict) {
 		prop_object_release(ncf->ncf_rules_list);
 		prop_object_release(ncf->ncf_rproc_list);
 		prop_object_release(ncf->ncf_table_list);
 		prop_object_release(ncf->ncf_nat_list);
-	} else {
-		prop_object_release(ncf->ncf_dict);
 	}
 	if (ncf->ncf_err) {
 		prop_object_release(ncf->ncf_err);
@@ -408,6 +406,9 @@ _npf_rule_foreach1(prop_array_t rules, u
 		(*func)(&nrl, nlevel);
 
 		subrules = prop_dictionary_get(rldict, "subrules");
+		if (!subrules) {
+			continue;
+		}
 		(void)_npf_rule_foreach1(subrules, nlevel + 1, func);
 		prop_object_release(subrules);
 	}

Index: src/usr.sbin/npf/npfctl/npf_var.h
diff -u src/usr.sbin/npf/npfctl/npf_var.h:1.1.2.3 src/usr.sbin/npf/npfctl/npf_var.h:1.1.2.4
--- src/usr.sbin/npf/npfctl/npf_var.h:1.1.2.3	Sun Nov 18 22:38:28 2012
+++ src/usr.sbin/npf/npfctl/npf_var.h	Mon Nov 19 18:16:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_var.h,v 1.1.2.3 2012/11/18 22:38:28 riz Exp $	*/
+/*	$NetBSD: npf_var.h,v 1.1.2.4 2012/11/19 18:16:18 riz Exp $	*/
 
 /*-
  * Copyright (c) 2011-2012 The NetBSD Foundation, Inc.
@@ -54,14 +54,14 @@
 static const char *npfvar_types[ ] = {
 	[NPFVAR_STRING]		= "string",
 	[NPFVAR_IDENTIFIER]	= "identifier",
-	[NPFVAR_VAR_ID]		= "var_id",
-	[NPFVAR_NUM]		= "num",
+	[NPFVAR_VAR_ID]		= "variable-id",
+	[NPFVAR_NUM]		= "number",
 	[NPFVAR_PORT_RANGE]	= "port-range",
 	[NPFVAR_TABLE]		= "table",
-	[NPFVAR_FAM]		= "fam",
-	[NPFVAR_PROC]		= "proc",
-	[NPFVAR_PROC_PARAM]	= "proc_param",
-	[NPFVAR_TCPFLAG]	= "tcpflag",
+	[NPFVAR_FAM]		= "family-address-mask",
+	[NPFVAR_PROC]		= "procedure",
+	[NPFVAR_PROC_PARAM]	= "procedure-parameter",
+	[NPFVAR_TCPFLAG]	= "tcp-flag",
 	[NPFVAR_ICMP]		= "icmp",
 	[NPFVAR_ICMP6]		= "icmp6"
 };

Reply via email to