Source-Changes-HG archive

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

[src/trunk]: src/sys/net Not to use ph_inout[2]. dir (= PFIL_IN or PFIL_OUT) ...



details:   https://anonhg.NetBSD.org/src/rev/378b034bd46c
branches:  trunk
changeset: 820236:378b034bd46c
user:      ryo <ryo%NetBSD.org@localhost>
date:      Wed Jan 04 13:03:41 2017 +0000

description:
Not to use ph_inout[2]. dir (= PFIL_IN or PFIL_OUT) is 1 or 2, not 0 or 1.

diffstat:

 sys/net/pfil.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (48 lines):

diff -r 3421f7abcb59 -r 378b034bd46c sys/net/pfil.c
--- a/sys/net/pfil.c    Wed Jan 04 12:35:14 2017 +0000
+++ b/sys/net/pfil.c    Wed Jan 04 13:03:41 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pfil.c,v 1.29 2016/12/26 23:21:49 christos Exp $       */
+/*     $NetBSD: pfil.c,v 1.30 2017/01/04 13:03:41 ryo Exp $    */
 
 /*
  * Copyright (c) 2013 Mindaugas Rasiukevicius <rmind at NetBSD org>
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.29 2016/12/26 23:21:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.30 2017/01/04 13:03:41 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -57,7 +57,8 @@
 CTASSERT(PFIL_OUT == 2);
 
 struct pfil_head {
-       pfil_list_t     ph_inout[2];
+       pfil_list_t     ph_in;
+       pfil_list_t     ph_out;
        pfil_list_t     ph_ifaddr;
        pfil_list_t     ph_ifevent;
        int             ph_type;
@@ -121,8 +122,9 @@
 {
        switch (dir) {
        case PFIL_IN:
+               return &ph->ph_in;
        case PFIL_OUT:
-               return &ph->ph_inout[dir];
+               return &ph->ph_out;
        case PFIL_IFADDR:
                return &ph->ph_ifaddr;
        case PFIL_IFNET:
@@ -286,7 +288,7 @@
        int ret = 0;
 
        KASSERT((dir & ~PFIL_ALL) == 0);
-       if (__predict_false((phlist = &ph->ph_inout[dir]) == NULL)) {
+       if (__predict_false((phlist = pfil_hook_get(dir, ph)) == NULL)) {
                return ret;
        }
 



Home | Main Index | Thread Index | Old Index