Module Name: src
Committed By: rmind
Date: Tue Dec 27 20:32:58 UTC 2016
Modified Files:
src/lib/libnpf: npf.c npf.h
Log Message:
KNF
To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libnpf/npf.c
cvs rdiff -u -r1.32 -r1.33 src/lib/libnpf/npf.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.41 src/lib/libnpf/npf.c:1.42
--- src/lib/libnpf/npf.c:1.41 Tue Dec 27 20:14:07 2016
+++ src/lib/libnpf/npf.c Tue Dec 27 20:32:58 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: npf.c,v 1.41 2016/12/27 20:14:07 christos Exp $ */
+/* $NetBSD: npf.c,v 1.42 2016/12/27 20:32:58 rmind Exp $ */
/*-
* Copyright (c) 2010-2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.41 2016/12/27 20:14:07 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.42 2016/12/27 20:32:58 rmind Exp $");
#include <sys/types.h>
#include <netinet/in_systm.h>
@@ -1427,18 +1427,18 @@ npf_conn_list(int fd, npf_conn_func_t fu
if (ncf == NULL) {
return errno;
}
-
- /* Connection list - array */
- if (prop_object_type(ncf->ncf_conn_list) != PROP_TYPE_ARRAY) {
- return EINVAL;
- }
-
- prop_object_iterator_t it = prop_array_iterator(ncf->ncf_conn_list);
- prop_dictionary_t condict;
- while ((condict = prop_object_iterator_next(it)) != NULL) {
- if (prop_object_type(condict) != PROP_TYPE_DICTIONARY) {
+
+ /* Connection list - array */
+ if (prop_object_type(ncf->ncf_conn_list) != PROP_TYPE_ARRAY) {
+ return EINVAL;
+ }
+
+ prop_object_iterator_t it = prop_array_iterator(ncf->ncf_conn_list);
+ prop_dictionary_t condict;
+ while ((condict = prop_object_iterator_next(it)) != NULL) {
+ if (prop_object_type(condict) != PROP_TYPE_DICTIONARY) {
return EINVAL;
- }
+ }
npf_conn_handle(condict, fun, v);
}
return 0;
Index: src/lib/libnpf/npf.h
diff -u src/lib/libnpf/npf.h:1.32 src/lib/libnpf/npf.h:1.33
--- src/lib/libnpf/npf.h:1.32 Tue Dec 27 20:14:07 2016
+++ src/lib/libnpf/npf.h Tue Dec 27 20:32:58 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: npf.h,v 1.32 2016/12/27 20:14:07 christos Exp $ */
+/* $NetBSD: npf.h,v 1.33 2016/12/27 20:32:58 rmind Exp $ */
/*-
* Copyright (c) 2011-2014 The NetBSD Foundation, Inc.
@@ -150,10 +150,9 @@ void _npf_debug_addif(nl_config_t *, co
int _npf_alg_load(nl_config_t *, const char *);
int _npf_alg_unload(nl_config_t *, const char *);
-/* utils */
-typedef int (*npf_conn_func_t)(unsigned, const npf_addr_t *, const in_port_t *,
- const char *, void *);
-int npf_conn_list(int, npf_conn_func_t, void *);
+typedef int (*npf_conn_func_t)(unsigned, const npf_addr_t *,
+ const in_port_t *, const char *, void *);
+int npf_conn_list(int, npf_conn_func_t, void *);
#endif