diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2006-03-25 22:41:49 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2006-03-25 22:41:49 +0000 |
commit | 24436414aab60dc84348ec54f23b324b4ae862a3 (patch) | |
tree | ee35283622a78eeac5656cb5661954771faf6520 /sys/net/if_strip.c | |
parent | d1265a1a72755bd0209950654a6df47287781241 (diff) |
allow bpf(4) to ignore packets based on their direction (inbound or
outbound), using a new BIOCSDIRFILT ioctl;
guidance, feedback and ok canacar@
Diffstat (limited to 'sys/net/if_strip.c')
-rw-r--r-- | sys/net/if_strip.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/if_strip.c b/sys/net/if_strip.c index 75e3038d7a2..7fc7024046f 100644 --- a/sys/net/if_strip.c +++ b/sys/net/if_strip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_strip.c,v 1.31 2006/03/11 22:44:47 brad Exp $ */ +/* $OpenBSD: if_strip.c,v 1.32 2006/03/25 22:41:47 djm Exp $ */ /* $NetBSD: if_strip.c,v 1.2.4.3 1996/08/03 00:58:32 jtc Exp $ */ /* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */ @@ -1000,7 +1000,8 @@ stripstart(tp) cp[SLX_DIR] = SLIPDIR_OUT; bcopy(mtod(m, caddr_t)+STRIP_HDRLEN, &cp[SLX_CHDR], CHDR_LEN); - bpf_tap(sc->sc_bpf, cp, len + SLIP_HDRLEN); + bpf_tap(sc->sc_bpf, cp, len + SLIP_HDRLEN, + BPF_DIRECTION_OUT); } #endif getmicrotime(&sc->sc_lastpacket); @@ -1252,7 +1253,7 @@ stripinput(c, tp) hp[SLX_DIR] = SLIPDIR_IN; bcopy(chdr, &hp[SLX_CHDR], CHDR_LEN); - bpf_tap(sc->sc_bpf, hp, len + SLIP_HDRLEN); + bpf_tap(sc->sc_bpf, hp, len + SLIP_HDRLEN, BPF_DIRECTION_IN); } #endif m = strip_btom(sc, len); |