Bug 343 - tcpdump with filter fails on tun and lo devices
Summary: tcpdump with filter fails on tun and lo devices
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 1995-04-14 09:20 UTC by jc
Modified: 1996-01-22 14:59 UTC (History)
0 users

See Also:

file.diff (3.08 KB, patch)
1995-04-14 09:20 UTC, jc
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.

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

Verified to be working correctly under -current.