Subject: kern/17901: bpf doesn't work properly on bridge interfaces
To: None <gnats-bugs@gnats.netbsd.org>
From: None <adam@lebsack.com>
List: netbsd-bugs
Date: 08/09/2002 14:29:56
>Number:         17901
>Category:       kern
>Synopsis:       bpf doesn't work properly on bridge interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 09 14:30:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Adam Lebsack
>Release:        NetBSD 1.6 BETA4
>Organization:
None
>Environment:
NetBSD molson 1.6_BETA4 NetBSD 1.6_BETA4 (MOLSON) #8: Fri Aug  2 03:41:06 MDT 2002     root@molson:/u1/MOLSON i386
>Description:
bpf packets are not sent to the filters for bridge member interfaces if the packet was forwarded to another interface.
>How-To-Repeat:
setup a bridge between 2 NICs and try to run dhclient on the interface on the opposite side of the bridge from your DHCP server.  TCP dump on that dhclient interface does not pick up any packets.
>Fix:
here's a patch:
--- sys/net/if_ethersubr.c.orig Fri Aug  9 15:23:28 2002
+++ sys/net/if_ethersubr.c      Fri Aug  9 15:24:28 2002
@@ -718,7 +718,13 @@
                 * Update our interface pointer -- we may have had
                 * to "bridge" the packet locally.
                 */
-               ifp = m->m_pkthdr.rcvif;
+               if(ifp != m->m_pkthdr.rcvif) {
+                       ifp = m->m_pkthdr.rcvif;
+#if NBPFILTER > 0
+                       if (ifp->if_bpf)
+                               bpf_mtap(ifp->if_bpf, m);
+#endif /* NPBFILTER > 0 */
+               }
        }
 #endif /* NBRIDGE > 0 */

>Release-Note:
>Audit-Trail:
>Unformatted: