Make this compile again in light of recent changes:
- adjust for new ipl_attach()/ipl_detach() names. - In ipl_load(), so not implicitly call ipl_attach(), since doing so would be inconsistent with the behavior exhibited by the statically-configured version.
This commit is contained in:
parent
e8fb8bd3a9
commit
85a327bb3b
@ -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 <bsd.kmod.mk>
|
||||
|
@ -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 <sys/param.h>
|
||||
|
||||
/*
|
||||
* 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 <osreldate.h>
|
||||
#endif
|
||||
@ -78,6 +69,7 @@ extern int lkmenodev __P((void));
|
||||
#ifdef NETBSD_PF
|
||||
#include <net/pfil.h>
|
||||
#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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user