Subject: [PATCH] Fix ie vm_fault without BPFILTER
To: None <port-sun3@netbsd.org>
From: Adam Kropelin <akropel1@rochester.rr.com>
List: port-sun3
Date: 05/25/2003 10:11:44
I finally got around to looking at the ie vm_fault I was hitting back in
November. Eventually tracked it to a null pointer deref when the kernel
is configured without a BPFILTER. The following minimal patch solves the
problem. I presume it affects all systems using if_ie with no BPFILTER
configured in.

This is against 1.6.1 stock.

--Adam

--- sys/arch/sun3/dev/if_ie.c.orig	Sat May 24 12:17:03 2003
+++ sys/arch/sun3/dev/if_ie.c	Sat May 24 12:17:49 2003
@@ -701,14 +701,11 @@
 	struct ether_header *eh;
 	int *to_bpf;
 {
-	struct ifnet *ifp;
-
-	ifp = &sc->sc_if;
 
 #if NBPFILTER > 0
+	struct ifnet *ifp;
+	ifp = &sc->sc_if;
 	*to_bpf = (ifp->if_bpf != 0);
-#else
-	*to_bpf = 0;
 #endif
 
 	/*