diff options
| -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 c250e603ecda2..24c99bfccfa0f 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; |
