[PATCH] Fix ie vm_fault without BPFILTER

Adam Kropelin <[email protected]>
Newsgroups gmane.os.netbsd.ports.sun3
Message-ID <[email protected]>
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
 
 	/*
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.