diff options
author | sam <sam@FreeBSD.org> | 2004-01-27 17:45:28 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2004-01-27 17:45:28 +0000 |
commit | 8908e99bdb9894b345f7bf290d8ecba0a3c49e94 (patch) | |
tree | 4a3589516be81cbc05fc6cd5c1a0dbfc5d78c1c4 /sys/netipsec | |
parent | 89b2bd490fa551e1cbb36a547c053851a9eb8d50 (diff) | |
download | FreeBSD-src-8908e99bdb9894b345f7bf290d8ecba0a3c49e94.zip FreeBSD-src-8908e99bdb9894b345f7bf290d8ecba0a3c49e94.tar.gz |
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
Diffstat (limited to 'sys/netipsec')
-rw-r--r-- | sys/netipsec/ipsec.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c index c250e60..24c99bf 100644 --- a/sys/netipsec/ipsec.c +++ b/sys/netipsec/ipsec.c @@ -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; |