Module Name:    src
Committed By:   rmind
Date:           Sat Nov 23 19:40:11 UTC 2013

Modified Files:
        src/usr.sbin/npf/npftest/libnpftest: npf_bpf_test.c

Log Message:
npftest: adjust for the npf_bpf_filter() change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c
diff -u src/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c:1.3 src/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c:1.4
--- src/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c:1.3	Sat Nov 16 01:41:43 2013
+++ src/usr.sbin/npf/npftest/libnpftest/npf_bpf_test.c	Sat Nov 23 19:40:11 2013
@@ -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 @@ test_bpf_code(void *code, size_t size)
 {
 	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 @@ test_bpf_code(void *code, size_t size)
 	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) {

Reply via email to