Module Name: src
Committed By: rmind
Date: Sat Nov 16 01:13:52 UTC 2013
Modified Files:
src/sys/net: bpf.c
Log Message:
bpf_deliver: convert to bpf_filter_ext().
To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/net/bpf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/bpf.c
diff -u src/sys/net/bpf.c:1.178 src/sys/net/bpf.c:1.179
--- src/sys/net/bpf.c:1.178 Fri Nov 15 00:12:44 2013
+++ src/sys/net/bpf.c Sat Nov 16 01:13:52 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.178 2013/11/15 00:12:44 rmind Exp $ */
+/* $NetBSD: bpf.c,v 1.179 2013/11/16 01:13:52 rmind Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.178 2013/11/15 00:12:44 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.179 2013/11/16 01:13:52 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_bpf.h"
@@ -1377,6 +1377,13 @@ static inline void
bpf_deliver(struct bpf_if *bp, void *(*cpfn)(void *, const void *, size_t),
void *pkt, u_int pktlen, u_int buflen, const bool rcv)
{
+ bpf_ctx_t *bc = bpf_default_ctx();
+ bpf_args_t args = {
+ .pkt = pkt,
+ .wirelen = pktlen,
+ .buflen = buflen,
+ .arg = NULL
+ };
struct bpf_d *d;
struct timespec ts;
bool gottime = false;
@@ -1395,10 +1402,10 @@ bpf_deliver(struct bpf_if *bp, void *(*c
d->bd_rcount++;
bpf_gstats.bs_recv++;
- if (d->bd_jitcode != NULL)
+ if (d->bd_jitcode)
slen = d->bd_jitcode(pkt, pktlen, buflen);
else
- slen = bpf_filter(d->bd_filter, pkt, pktlen, buflen);
+ slen = bpf_filter_ext(bc, d->bd_filter, &args);
if (!slen) {
continue;