From 04552c0160ae8925497d5ffe8e220d019e5ab606 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Fri, 24 Jan 2014 09:48:38 +0000 Subject: computing the ip csum just before the bpf mtap and only if there is a consumer just to please tcpdump is stupid and not done anywhere else. kill with fire. ok benno --- sys/net/if_pflow.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/net/if_pflow.c b/sys/net/if_pflow.c index af7453c5974..07ddf122283 100644 --- a/sys/net/if_pflow.c +++ b/sys/net/if_pflow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflow.c,v 1.39 2014/01/21 21:27:14 benno Exp $ */ +/* $OpenBSD: if_pflow.c,v 1.40 2014/01/24 09:48:37 henning Exp $ */ /* * Copyright (c) 2011 Florian Obser @@ -1544,10 +1544,8 @@ pflow_sendout_mbuf(struct pflow_softc *sc, struct mbuf *m) ip->ip_len = htons(sizeof(struct udpiphdr) + len); #if NBPFILTER > 0 - if (ifp->if_bpf) { - ip->ip_sum = in_cksum(m, ip->ip_hl << 2); + if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT); - } #endif sc->sc_if.if_opackets++; -- cgit v1.2.3