npf_config_submit: finally, include the saved connections.

This commit is contained in:
rmind 2014-08-24 20:37:35 +00:00
parent b1889f11ee
commit 209a62dda0
1 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: npf.c,v 1.33 2014/08/11 23:48:01 rmind Exp $ */
/* $NetBSD: npf.c,v 1.34 2014/08/24 20:37:35 rmind Exp $ */
/*-
* Copyright (c) 2010-2014 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.33 2014/08/11 23:48:01 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.34 2014/08/24 20:37:35 rmind Exp $");
#include <sys/types.h>
#include <netinet/in_systm.h>
@ -69,13 +69,14 @@ struct nl_ext {
};
struct nl_config {
/* Rules, translations, tables, procedures. */
/* Rules, translations, procedures, tables, connections. */
prop_dictionary_t ncf_dict;
prop_array_t ncf_alg_list;
prop_array_t ncf_rules_list;
prop_array_t ncf_rproc_list;
prop_array_t ncf_table_list;
prop_array_t ncf_nat_list;
prop_array_t ncf_conn_list;
/* Iterators. */
prop_object_iterator_t ncf_rule_iter;
@ -153,6 +154,10 @@ npf_config_submit(nl_config_t *ncf, int fd)
prop_dictionary_set(npf_dict, "rprocs", ncf->ncf_rproc_list);
prop_dictionary_set(npf_dict, "tables", ncf->ncf_table_list);
prop_dictionary_set(npf_dict, "nat", ncf->ncf_nat_list);
if (ncf->ncf_conn_list) {
prop_dictionary_set(npf_dict, "conn-list",
ncf->ncf_conn_list);
}
prop_dictionary_set_bool(npf_dict, "flush", ncf->ncf_flush);
if (ncf->ncf_debug) {
prop_dictionary_set(npf_dict, "debug", ncf->ncf_debug);
@ -194,6 +199,7 @@ _npf_config_consdict(prop_dictionary_t npf_dict)
ncf->ncf_rproc_list = prop_dictionary_get(npf_dict, "rprocs");
ncf->ncf_table_list = prop_dictionary_get(npf_dict, "tables");
ncf->ncf_nat_list = prop_dictionary_get(npf_dict, "nat");
ncf->ncf_conn_list = prop_dictionary_get(npf_dict, "conn-list");
return ncf;
}