Subject: kern/34517: re(4) drops all traffic in promiscuous mode
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Andreas Gustafsson <gson@gson.org>
List: netbsd-bugs
Date: 09/13/2006 14:10:00
>Number:         34517
>Category:       kern
>Synopsis:       re(4) drops all traffic in promiscuous mode
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 13 14:10:00 +0000 2006
>Originator:     Andreas Gustafsson
>Release:        NetBSD 3.99.24
>Organization:
>Environment:
System: NetBSD guava.gson.org 3.99.24 NetBSD 3.99.24 (GENERIC) #0: Fri Aug 4 13:14:16 EEST 2006 root@guru.araneus.fi:/usr/build/1005/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

When a re(4) Ethernet interface is put into promiscuous mode by
tcpdump, it stops passing traffic.

>How-To-Repeat:

In one terminal window, ping another machine connected through a re(4)
interface.

In another terminal window, attempt to monitor the ping traffic using
tcpdump (without specifying the -p option)

Observe how tcpdump shows the outgoing ping packets, but no incoming
ones.  Also, observe how ping shows no packets being received while
tcpdump is running.

Here is some sample output from ping (tcpdump was started
at 7 seconds, and interrupted after 25 seconds):

  guava ~ $ ping -n 10.0.1.254
  PING 10.0.1.254 (10.0.1.254): 56 data bytes
  64 bytes from 10.0.1.254: icmp_seq=0 ttl=255 time=2.310 ms
  64 bytes from 10.0.1.254: icmp_seq=1 ttl=255 time=2.331 ms
  64 bytes from 10.0.1.254: icmp_seq=2 ttl=255 time=2.335 ms
  64 bytes from 10.0.1.254: icmp_seq=3 ttl=255 time=2.355 ms
  64 bytes from 10.0.1.254: icmp_seq=4 ttl=255 time=2.360 ms
  64 bytes from 10.0.1.254: icmp_seq=5 ttl=255 time=2.972 ms
  64 bytes from 10.0.1.254: icmp_seq=6 ttl=255 time=2.425 ms
  64 bytes from 10.0.1.254: icmp_seq=7 ttl=255 time=2.377 ms
  64 bytes from 10.0.1.254: icmp_seq=25 ttl=255 time=2.320 ms
  64 bytes from 10.0.1.254: icmp_seq=26 ttl=255 time=2.273 ms
  64 bytes from 10.0.1.254: icmp_seq=27 ttl=255 time=2.277 ms
  64 bytes from 10.0.1.254: icmp_seq=28 ttl=255 time=3.098 ms
  64 bytes from 10.0.1.254: icmp_seq=29 ttl=255 time=3.612 ms
  ^C
  ----10.0.1.254 PING Statistics----
  30 packets transmitted, 13 packets received, 56.7% packet loss
  round-trip min/avg/max/stddev = 2.273/2.542/3.612/0.416 ms

And here is the corresponding output from tcpdump:

  guava /u/gson # tcpdump -n -i re0
  tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
  listening on re0, link-type EN10MB (Ethernet), capture size 96 bytes
  10:14:49.415676 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 8
  10:14:50.415690 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 9
  10:14:51.415702 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 10
  10:14:52.415711 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 11
  10:14:53.415737 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 12
  10:14:54.415740 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 13
  10:14:55.415753 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 14
  10:14:56.415775 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 15
  10:14:57.415787 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 16
  10:14:58.415803 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 17
  10:14:59.415817 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 18
  10:15:00.415830 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 19
  10:15:01.415821 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 20
  10:15:02.415620 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 21
  10:15:03.415137 IP 10.0.1.1 > 10.0.1.254: icmp 64: echo request seq 22
  ^C
  15 packets captured
  16 packets received by filter
  0 packets dropped by kernel

Here is the relevant dmesg output:

  re0 at pci0 dev 11 function 0: RealTek 8169S Single-chip Gigabit Ethernet
  re0: interrupting at irq 9
  re0: Ethernet address 00:50:fc:fe:81:9a
  re0: using 256 tx descriptors
  rgephy0 at re0 phy 7: RTL8169S/8110S 1000BASE-T media interface, rev. 0
  rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto

>Fix:

None provided.