From ue@nathan.ruhr.de  Mon Jun 19 08:46:22 2000
Return-Path: <ue@nathan.ruhr.de>
Received: from mail.ruhr.de (in-ruhr2.ruhr.de [141.39.224.60])
	by hub.freebsd.org (Postfix) with SMTP id 1577D37BD35
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Jun 2000 08:46:18 -0700 (PDT)
	(envelope-from ue@nathan.ruhr.de)
Received: (qmail 5863 invoked by alias); 19 Jun 2000 15:45:25 -0000
Received: (from ue@localhost)
	by nathan.ruhr.de (8.9.3/8.9.3) id RAA08024;
	Mon, 19 Jun 2000 17:46:58 +0200 (CEST)
	(envelope-from ue)
Message-Id: <200006191546.RAA08024@nathan.ruhr.de>
Date: Mon, 19 Jun 2000 17:46:58 +0200 (CEST)
From: Udo Erdelhoff <ue@nathan.ruhr.de>
Reply-To: ue@nathan.ruhr.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: tcpdump and tun-Device
X-Send-Pr-Version: 3.2

>Number:         19377
>Category:       bin
>Synopsis:       tcpdump -i tun0 not port/host x shows incoming traffic for that host/port
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 19 08:50:01 PDT 2000
>Closed-Date:    Sun Oct 15 13:22:44 PDT 2000
>Last-Modified:  Sun Oct 15 13:23:19 PDT 2000
>Originator:     Udo Erdelhoff
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
private User
>Environment:

-current as of 18-JUN-2000 
buildworld/installworld/new kernel
ppp-connections over PPPoE and "conventional" modems with and without nat

>Description:

According to manpage, ``tcpdump not port X'' should not display traffic
from or to that port. Likewise, ``tcpdump not host X'' should not display
traffic from or to that host.

tcpdump works "as advertised" when I'm snooping on a conventional interface 
(tested with bofh ed and fxp). If I'm sniffing on the tun device, tcpdump
will still capture and display the incoming traffic. Using ``tcpdump not
( port X ) '' or ``tcpdump not ( src port X )'' doesn't change anything.

>How-To-Repeat:

use tcpdump not port X on a tun device with traffic for that port

>Fix:


>Release-Note:
>Audit-Trail:

From: Udo Erdelhoff <ue@nathan.ruhr.de>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/19377: tcpdump and tun-Device
Date: Wed, 21 Jun 2000 23:55:27 +0200

 Some additional datapoints:
 - the problem also exists in both 4.0-RELEASE and RELENG-4 as of 08-JUN
 - "postive" filtering (e.g. tcpdump -i tun0 port foo) works as expected
 - Doing a tcpdump -i tun0 -w file and then tcpdump -r file not port foo
   show the same symptoms. Using the same commandline on a file captured
   from an ethernet device works as expected
 

From: Bill Fenner <fenner@research.att.com>
To: ue@nathan.ruhr.de
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/19377: tcpdump and tun-Device
Date: Thu, 29 Jun 2000 22:42:16 -0700

 Can you follow up with the output of
 tcpdump -d -i tun0 port foo
 tcpdump -d -i tun0 not port foo
 
 Thanks,
   Bill
 

From: Udo Erdelhoff <ue@nathan.ruhr.de>
To: Bill Fenner <fenner@research.att.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/19377: tcpdump and tun-Device
Date: Fri, 30 Jun 2000 12:26:09 +0200

 > tcpdump -d -i tun0 port foo
 (000) ld       [0]
 (001) jeq      #0x1c000000      jt 2	jf 9
 (002) ldb      [10]
 (003) jeq      #0x6             jt 5	jf 4
 (004) jeq      #0x11            jt 5	jf 21
 (005) ldh      [44]
 (006) jeq      #0x50            jt 20	jf 7
 (007) ldh      [46]
 (008) jeq      #0x50            jt 20	jf 21
 (009) jeq      #0x2000000       jt 10	jf 21
 (010) ldb      [13]
 (011) jeq      #0x6             jt 13	jf 12
 (012) jeq      #0x11            jt 13	jf 21
 (013) ldh      [10]
 (014) jset     #0x1fff          jt 21	jf 15
 (015) ldxb     4*([4]&0xf)
 (016) ldh      [x + 4]
 (017) jeq      #0x50            jt 20	jf 18
 (018) ldh      [x + 6]
 (019) jeq      #0x50            jt 20	jf 21
 (020) ret      #96
 (021) ret      #0
 
 > tcpdump -d -i tun0 not port foo
 
 (000) ld       [0]
 (001) jeq      #0x1c000000      jt 2	jf 9
 (002) ldb      [10]
 (003) jeq      #0x6             jt 5	jf 4
 (004) jeq      #0x11            jt 5	jf 21
 (005) ldh      [44]
 (006) jeq      #0x50            jt 20	jf 7
 (007) ldh      [46]
 (008) jeq      #0x50            jt 20	jf 21
 (009) jeq      #0x2000000       jt 10	jf 21
 (010) ldb      [13]
 (011) jeq      #0x6             jt 13	jf 12
 (012) jeq      #0x11            jt 13	jf 21
 (013) ldh      [10]
 (014) jset     #0x1fff          jt 21	jf 15
 (015) ldxb     4*([4]&0xf)
 (016) ldh      [x + 4]
 (017) jeq      #0x50            jt 20	jf 18
 (018) ldh      [x + 6]
 (019) jeq      #0x50            jt 20	jf 21
 (020) ret      #0
 (021) ret      #96
 
 Good hunting!
 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Sun Oct 15 13:22:44 PDT 2000 
State-Changed-Why:  
Fixed in -current 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19377 
>Unformatted:
