1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

Merge vendor changes from 3.2.1 -> 3.2.3 onto mainline

This commit is contained in:
Peter Wemm 1998-03-21 10:20:13 +00:00
parent 65c83eff1e
commit 48cb3612ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=34745

View File

@ -136,6 +136,10 @@ SYSCTL_INT(_net_inet_ipf, OID_AUTO, fr_defaultauthage, CTLFLAG_RW,
&fr_defaultauthage, 0, ""); &fr_defaultauthage, 0, "");
#endif #endif
#ifdef DEVFS
void *ipf_devfs[IPL_LOGMAX + 1];
#endif
#if !defined(__FreeBSD_version) || (__FreeBSD_version < 220000) #if !defined(__FreeBSD_version) || (__FreeBSD_version < 220000)
int ipl_major = 0; int ipl_major = 0;
@ -157,6 +161,7 @@ static struct cdevsw ipl_cdevsw = {
static int iplaction __P((struct lkm_table *, int)); static int iplaction __P((struct lkm_table *, int));
static void ipl_drvinit __P((void *));
static int iplaction(lkmtp, cmd) static int iplaction(lkmtp, cmd)
@ -189,13 +194,27 @@ int cmd;
args->lkm_offset = i; /* slot in cdevsw[] */ args->lkm_offset = i; /* slot in cdevsw[] */
#endif #endif
printf("IP Filter: loaded into slot %d\n", ipl_major); printf("IP Filter: loaded into slot %d\n", ipl_major);
return if_ipl_load(lkmtp, cmd); err = if_ipl_load(lkmtp, cmd);
if (!err)
ipl_drvinit((void *)NULL);
return err;
break; break;
case LKM_E_UNLOAD : case LKM_E_UNLOAD :
err = if_ipl_unload(lkmtp, cmd); err = if_ipl_unload(lkmtp, cmd);
if (!err) if (!err) {
printf("IP Filter: unloaded from slot %d\n", printf("IP Filter: unloaded from slot %d\n",
ipl_major); ipl_major);
# ifdef DEVFS
if (ipf_devfs[IPL_LOGIPF])
devfs_remove_dev(ipf_devfs[IPL_LOGIPF]);
if (ipf_devfs[IPL_LOGNAT])
devfs_remove_dev(ipf_devfs[IPL_LOGNAT]);
if (ipf_devfs[IPL_LOGSTATE])
devfs_remove_dev(ipf_devfs[IPL_LOGSTATE]);
if (ipf_devfs[IPL_LOGAUTH])
devfs_remove_dev(ipf_devfs[IPL_LOGAUTH]);
# endif
}
return err; return err;
case LKM_E_STAT : case LKM_E_STAT :
break; break;
@ -327,42 +346,37 @@ int cmd, ver;
{ {
DISPATCH(lkmtp, cmd, ver, iplaction, iplaction, iplaction); DISPATCH(lkmtp, cmd, ver, iplaction, iplaction, iplaction);
} }
# else # endif
#ifdef DEVFS
static void *ipf_devfs_token[IPL_LOGMAX + 1];
#endif
static ipl_devsw_installed = 0; static ipl_devsw_installed = 0;
static void ipl_drvinit __P((void *unused)) static void ipl_drvinit __P((void *unused))
{ {
dev_t dev; dev_t dev;
#ifdef DEVFS # ifdef DEVFS
void **tp = ipf_devfs_token; void **tp = ipf_devfs;
#endif # endif
if (!ipl_devsw_installed ) { if (!ipl_devsw_installed ) {
dev = makedev(CDEV_MAJOR, 0); dev = makedev(CDEV_MAJOR, 0);
cdevsw_add(&dev, &ipl_cdevsw, NULL); cdevsw_add(&dev, &ipl_cdevsw, NULL);
ipl_devsw_installed = 1; ipl_devsw_installed = 1;
#ifdef DEVFS # ifdef DEVFS
tp[IPL_LOGIPF] = devfs_add_devswf(&ipl_cdevsw, IPL_LOGIPF, tp[IPL_LOGIPF] = devfs_add_devswf(&ipl_cdevsw, IPL_LOGIPF,
DV_CHR, 0, 0, 0600, DV_CHR, 0, 0, 0600, "ipf");
"ipf", IPL_LOGIPF);
tp[IPL_LOGNAT] = devfs_add_devswf(&ipl_cdevsw, IPL_LOGNAT, tp[IPL_LOGNAT] = devfs_add_devswf(&ipl_cdevsw, IPL_LOGNAT,
DV_CHR, 0, 0, 0600, DV_CHR, 0, 0, 0600, "ipnat");
"ipnat", IPL_LOGNAT);
tp[IPL_LOGSTATE] = devfs_add_devswf(&ipl_cdevsw, IPL_LOGSTATE, tp[IPL_LOGSTATE] = devfs_add_devswf(&ipl_cdevsw, IPL_LOGSTATE,
DV_CHR, 0, 0, 0600, DV_CHR, 0, 0, 0600,
"ipstate", IPL_LOGSTATE); "ipstate");
tp[IPL_LOGAUTH] = devfs_add_devswf(&ipl_cdevsw, IPL_LOGAUTH, tp[IPL_LOGAUTH] = devfs_add_devswf(&ipl_cdevsw, IPL_LOGAUTH,
DV_CHR, 0, 0, 0600, DV_CHR, 0, 0, 0600,
"ipstate", IPL_LOGAUTH); "ipauth");
#endif # endif
} }
} }
# ifdef IPFILTER_LKM
SYSINIT(ipldev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ipl_drvinit,NULL) SYSINIT(ipldev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ipl_drvinit,NULL)
# endif /* IPFILTER_LKM */ # endif /* IPFILTER_LKM */
#endif /* _FreeBSD_version */ #endif /* _FreeBSD_version */