Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libnpf KNF



details:   https://anonhg.NetBSD.org/src/rev/c6b94fe9aacf
branches:  trunk
changeset: 820048:c6b94fe9aacf
user:      rmind <rmind%NetBSD.org@localhost>
date:      Tue Dec 27 20:32:58 2016 +0000

description:
KNF

diffstat:

 lib/libnpf/npf.c |  26 +++++++++++++-------------
 lib/libnpf/npf.h |   9 ++++-----
 2 files changed, 17 insertions(+), 18 deletions(-)

diffs (71 lines):

diff -r 006b06aa5a1b -r c6b94fe9aacf lib/libnpf/npf.c
--- a/lib/libnpf/npf.c  Tue Dec 27 20:24:32 2016 +0000
+++ b/lib/libnpf/npf.c  Tue Dec 27 20:32:58 2016 +0000
@@ -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 @@
        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;
diff -r 006b06aa5a1b -r c6b94fe9aacf lib/libnpf/npf.h
--- a/lib/libnpf/npf.h  Tue Dec 27 20:24:32 2016 +0000
+++ b/lib/libnpf/npf.h  Tue Dec 27 20:32:58 2016 +0000
@@ -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 @@
 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
 



Home | Main Index | Thread Index | Old Index