From 209a62dda0115166228f879d5dffcc306ab0ac85 Mon Sep 17 00:00:00 2001 From: rmind Date: Sun, 24 Aug 2014 20:37:35 +0000 Subject: [PATCH] npf_config_submit: finally, include the saved connections. --- lib/libnpf/npf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/libnpf/npf.c b/lib/libnpf/npf.c index bee24784159a..ab89e7e4b78f 100644 --- a/lib/libnpf/npf.c +++ b/lib/libnpf/npf.c @@ -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 -__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 #include @@ -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; }