o add missing break

o remove extraneous bzero
o add SYSINIT to properly initialize ip4_def_policy

Submitted by:	"Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net>
Submitted by:	gnn@neville-neil.com
This commit is contained in:
Sam Leffler 2004-01-27 17:45:28 +00:00
parent 8976be9465
commit 8381996e5d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125100

View File

@ -403,7 +403,6 @@ ipsec_getpolicybyaddr(m, dir, flag, error)
if (*error != 0) {
DPRINTF(("%s: setpidx failed, dir %u flag %u\n",
__func__, dir, flag));
bzero(&spidx, sizeof (spidx));
return NULL;
}
spidx.dir = dir;
@ -1298,6 +1297,7 @@ ipsec_get_reqlevel(isr)
level = ah_net_deflev;
else
level = ah_trans_deflev;
break;
case IPPROTO_IPCOMP:
/*
* we don't really care, as IPcomp document says that
@ -1891,6 +1891,15 @@ ipsec_dumpmbuf(m)
printf("---\n");
}
static void
ipsec_attach(void)
{
SECPOLICY_LOCK_INIT(&ip4_def_policy);
ip4_def_policy.refcnt = 1; /* NB: disallow free */
}
SYSINIT(ipsec, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, ipsec_attach, NULL)
/* XXX this stuff doesn't belong here... */
static struct xformsw* xforms = NULL;