Bug 71711

Summary: [bpf] [patch] generate a single bpf timestamp for each packet
Product: Base System Reporter: mjl
Component: kernAssignee: dwmalone
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description mjl 2004-09-13 21:40:29 UTC
      I'm using BPF to obtain the transmit timestamp of packets I send.  I noticed that the timestamps differed slightly between what I was seeing and what tcpdump saw.  The cause of this is that timestamps are generated for each bpf fd if the packet passes the filter.  The bpf(4) documentation is accurate for this case, but I'm wondering if it makes more sense to generate the timestamp once for each packet, as it allows a more accurate estimation of when the packet might have hit the wire.

Fix: I took the liberty of optimising bpf_mtap a little while generating the patch.  I also removed code for generating timestamps based on the kernel being run, as the code would be duplicated in two places.  I'm happy to generate a macro and stick it in bpf_compat.h
How-To-Repeat:       Open two tcpdump sessions that capture the same packets.  You'll notice the timestamps differ slightly.
Comment 1 dwmalone freebsd_committer freebsd_triage 2006-07-24 16:42:09 UTC
Responsible Changed
From-To: freebsd-bugs->dwmalone

I've committed a patch to -current. I will MFC in about a month.
Comment 2 dwmalone freebsd_committer freebsd_triage 2007-01-17 09:36:43 UTC
State Changed
From-To: open->closed

I merged this some time ago, but forgot to close the PR.