NetBSD Problem Report #8343

Received: (qmail 11490 invoked from network); 7 Sep 1999 23:33:43 -0000
Message-Id: <199909072338.AAA00546@buzzard.cambridge.arm.com>
Date: Wed, 8 Sep 1999 00:38:50 +0100 (BST)
From: rearnsha@arm.com
Reply-To: rearnsha@cambridge.arm.com
To: gnats-bugs@gnats.netbsd.org
Subject: bpf bug in if_ie.c
X-Send-Pr-Version: 3.95

>Number:         8343
>Category:       port-arm32
>Synopsis:       bpf bug in if_ie.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-arm32-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 07 16:35:00 +0000 1999
>Closed-Date:    Tue Sep 14 06:14:13 +0000 1999
>Last-Modified:  Tue Sep 14 06:16:51 +0000 1999
>Originator:     Richard Earnshaw
>Release:        1.4 or later
>Organization:
ARM

>Environment:

System: NetBSD buzzard.cambridge.arm.com 1.4 NetBSD 1.4 (BUZZARD) #161: Tue Sep 7 21:21:53 BST 1999 rearnsha@buzzard.cambridge.arm.com:/home/rearnsha/netbsd/src/sys/arch/arm32/compile/BUZZARD arm32


>Description:
	The #ifdef BPFILTER in podulebus/if_ie.c is miss-spelt.  Further, the
	header of ethernet package is not passed to the filter, which causes
	it to interpret the packet incorrectly.

	Without this patch it is impossible to serve DHCP on this
	interface.


>How-To-Repeat:
	Try to start dhcp on a subnet that is on a if_ie interface.  
	Observe that nothing happens :-(.

	Try to run tcpdump on the same interface; observe that no input
	packets are dumped :-(

	Fix the name of the #ifdef; observe that dumped input packets are
	garbage :-(

>Fix:
	Patch attached.  The patch uses the same trick as that in 
	net/if_loop.c (and probably other places).

*** /usr/src/sys/arch/arm32/podulebus/if_ie.c	Sun Mar 28 18:50:01 1999
--- if_ie.c	Tue Sep  7 21:20:53 1999
*************** ie_read_frame(sc, num)
*** 1314,1322 ****
  		ether_sprintf(eh.ether_shost), (u_int)eh.ether_type );
  */

! #if NBFILTER > 0
      if ( ifp->if_bpf ) {
! 	bpf_mtap(ifp->if_bpf, m );
      };
  #endif

--- 1314,1331 ----
  		ether_sprintf(eh.ether_shost), (u_int)eh.ether_type );
  */

! #if NBPFILTER > 0
      if ( ifp->if_bpf ) {
!         /* We need to pass the ethernet header; cons up an mbuf to hold it.
! 	   This is safe since the bpf will only read the packet, it will
! 	   never try to free it.  */
! 	struct mbuf m0;
! 
! 	m0.m_next = m;
! 	m0.m_len = sizeof (struct ether_header);
! 	m0.m_data = (char *)&eh;
! 
! 	bpf_mtap(ifp->if_bpf, &m0 );
      };
  #endif


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: tron 
State-Changed-When: Mon Sep 13 13:20:39 PDT 1999 
State-Changed-Why:  
In NetBSD-current the mac header is passed to the BPF correctly. The "#ifdef" 
was still broken but is fixed now. 
I'll check if we can apply your patch to the release branch. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: tron 
State-Changed-When: Mon Sep 13 23:14:13 PDT 1999 
State-Changed-Why:  
Your patch has been applied to the release branch, thanks. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.