Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/npf/npftest/libnpftest npftest: adjust for the npf_...



details:   https://anonhg.NetBSD.org/src/rev/e9bfa4d56e86
branches:  trunk
changeset: 791566:e9bfa4d56e86
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat Nov 23 19:40:11 2013 +0000

description:
npftest: adjust for the npf_bpf_filter() change.

diffstat:

 usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r e52dfae3eab3 -r e9bfa4d56e86 usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c
--- a/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c    Sat Nov 23 19:32:20 2013 +0000
+++ b/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c    Sat Nov 23 19:40:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf_bpf_test.c,v 1.3 2013/11/16 01:41:43 rmind Exp $   */
+/*     $NetBSD: npf_bpf_test.c,v 1.4 2013/11/23 19:40:11 rmind Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -63,6 +63,7 @@
 {
        ifnet_t *dummy_ifp = npf_test_addif(IFNAME_TEST, false, false);
        npf_cache_t npc = { .npc_info = 0 };
+       bpf_args_t bc_args;
        struct mbuf *m;
        nbuf_t nbuf;
        int ret, jret;
@@ -73,12 +74,17 @@
        nbuf_init(&nbuf, m, dummy_ifp);
        npf_cache_all(&npc, &nbuf);
 
-       ret = npf_bpf_filter(&npc, &nbuf, code, NULL);
+       memset(&bc_args, 0, sizeof(bpf_args_t));
+       bc_args.pkt = m;
+       bc_args.wirelen = m_length(m);
+       bc_args.arg = &npc;
+
+       ret = npf_bpf_filter(&bc_args, code, NULL);
 
        /* JIT-compiled code. */
        jcode = npf_bpf_compile(code, size);
        if (jcode) {
-               jret = npf_bpf_filter(&npc, &nbuf, NULL, jcode);
+               jret = npf_bpf_filter(&bc_args, NULL, jcode);
                assert(ret == jret);
                bpf_jit_freecode(jcode);
        } else if (lverbose) {



Home | Main Index | Thread Index | Old Index