Bug 343

Summary: tcpdump with filter fails on tun and lo devices
Product: Base System Reporter: jc <jc>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description jc 1995-04-14 09:20:01 UTC
The packet filter fails to capture any packets when tcpdump is used
with a filter expression on the tunnel or loopback device.

Fix: I am not sure if the problem is in the drivers, the kernel packet
filter, or in tcpdump.  The loopback and tunnel devices attach to
the bpf with a device type of DLT_NULL and dummy up a link level
header that contains the adddress family for the packet, always
AF_INET.  Using a dummy PPP header in the drivers and attaching to
the bpf with DLT_PPP works.

This patch is probably not the correct fix but it will provide the
missing functionality.  A bpf guru needs to fix this the right way.

How-To-Repeat: 
tcpdump -i lo0 icmp      on one terminal
ping localhost           on another terminal
Comment 1 mpp freebsd_committer freebsd_triage 1996-01-22 14:58:36 UTC
State Changed
From-To: open->closed

Verified to be working correctly under -current.