Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Fix for npfctl show case. Improve some description while here.
details: https://anonhg.NetBSD.org/src/rev/329c0d602c78
branches: trunk
changeset: 782325:329c0d602c78
user: rmind <rmind%NetBSD.org@localhost>
date: Sun Oct 28 16:27:20 2012 +0000
description:
Fix for npfctl show case. Improve some description while here.
diffstat:
lib/libnpf/npf.c | 11 ++++++-----
usr.sbin/npf/npfctl/npf_var.h | 14 +++++++-------
2 files changed, 13 insertions(+), 12 deletions(-)
diffs (73 lines):
diff -r b22914cc5118 -r 329c0d602c78 lib/libnpf/npf.c
--- a/lib/libnpf/npf.c Sun Oct 28 16:25:02 2012 +0000
+++ b/lib/libnpf/npf.c Sun Oct 28 16:27:20 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf.c,v 1.13 2012/09/16 13:47:42 rmind Exp $ */
+/* $NetBSD: npf.c,v 1.14 2012/10/28 16:27:20 rmind 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.13 2012/09/16 13:47:42 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.14 2012/10/28 16:27:20 rmind Exp $");
#include <sys/types.h>
#include <netinet/in_systm.h>
@@ -213,13 +213,11 @@
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 @@
(*func)(&nrl, nlevel);
subrules = prop_dictionary_get(rldict, "subrules");
+ if (!subrules) {
+ continue;
+ }
(void)_npf_rule_foreach1(subrules, nlevel + 1, func);
prop_object_release(subrules);
}
diff -r b22914cc5118 -r 329c0d602c78 usr.sbin/npf/npfctl/npf_var.h
--- a/usr.sbin/npf/npfctl/npf_var.h Sun Oct 28 16:25:02 2012 +0000
+++ b/usr.sbin/npf/npfctl/npf_var.h Sun Oct 28 16:27:20 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: npf_var.h,v 1.4 2012/09/16 13:47:41 rmind Exp $ */
+/* $NetBSD: npf_var.h,v 1.5 2012/10/28 16:27:20 rmind 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"
};
Home |
Main Index |
Thread Index |
Old Index