diff --git a/sys/lkm/netinet/if_ipl/Makefile b/sys/lkm/netinet/if_ipl/Makefile index f41473283df9..c62e8467de97 100644 --- a/sys/lkm/netinet/if_ipl/Makefile +++ b/sys/lkm/netinet/if_ipl/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 1997/03/29 01:42:33 thorpej Exp $ +# $NetBSD: Makefile,v 1.3 1997/03/29 03:03:08 thorpej Exp $ .include "../Makefile.inc" @@ -8,4 +8,6 @@ KMOD= if_ipl SRCS= ip_fil.c fil.c mln_ipl.c ip_nat.c ip_frag.c ip_state.c NOMAN= yes +CFLAGS+=-DIPFILTER_LKM + .include diff --git a/sys/lkm/netinet/if_ipl/mln_ipl.c b/sys/lkm/netinet/if_ipl/mln_ipl.c index e08ced6363d1..56984ba26f2f 100644 --- a/sys/lkm/netinet/if_ipl/mln_ipl.c +++ b/sys/lkm/netinet/if_ipl/mln_ipl.c @@ -1,4 +1,4 @@ -/* $NetBSD: mln_ipl.c,v 1.5 1997/03/29 01:42:35 thorpej Exp $ */ +/* $NetBSD: mln_ipl.c,v 1.6 1997/03/29 03:03:09 thorpej Exp $ */ /* * (C)opyright 1993,1994,1995 by Darren Reed. @@ -15,15 +15,6 @@ #include -/* - * Post NetBSD 1.2 has the PFIL interface for packet filters. This turns - * on those hooks. We don't need any special mods with this! - */ -#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \ - (defined(NetBSD1_2) && NetBSD1_2 > 1) -# define NETBSD_PF -#endif - #if defined(__FreeBSD__) && (__FreeBSD__ > 1) # include #endif @@ -78,6 +69,7 @@ extern int lkmenodev __P((void)); #ifdef NETBSD_PF #include #endif + #ifndef IPFILTER_LOG # ifdef NETBSD_PF # define iplread enodev @@ -86,10 +78,6 @@ extern int lkmenodev __P((void)); # endif #endif -#ifdef NETBSD_PF -int (*fr_checkp) __P((struct ip *, int, struct ifnet *, int, struct mbuf **)) = NULL; -#endif - static int ipl_unload __P((void)); static int ipl_load __P((void)); static int ipl_remove __P((void)); @@ -151,7 +139,7 @@ int cmd; return EEXIST; for (i = 0; i < nchrdev; i++) - if (cdevsw[i].d_open == lkmenodev || + if (cdevsw[i].d_open == (void *)lkmenodev || cdevsw[i].d_open == iplopen) break; if (i == nchrdev) { @@ -211,10 +199,12 @@ static int ipl_unload() { int error; - error = ipfilterdetach(); -#ifdef NETBSD_PF - pfil_remove_hook(fr_check, PFIL_IN|PFIL_OUT); -#endif + /* + * Unloading - remove the filter rule check from the IP + * input/output stream. + */ + error = ipl_detach(); + if (!error) error = ipl_remove(); return error; @@ -227,12 +217,6 @@ static int ipl_load() struct vattr vattr; int error, fmode = S_IFCHR|0600; - error = ipfilterattach(); - if (error) - return error; -#ifdef NETBSD_PF - pfil_add_hook(fr_check, PFIL_IN|PFIL_OUT); -#endif (void) ipl_remove(); error = 0;