--- old/iked/ikev1/handler.c Fri Mar 27 12:09:52 2009 +++ new/iked/ikev1/handler.c Fri Mar 27 12:09:52 2009 @@ -275,8 +275,10 @@ EVT_PUSH(iph1->local, iph1->remote, EVTT_PHASE1_DOWN, NULL); #ifdef ENABLE_NATT +#ifndef sun /* XXX KEBE SAYS kernel does this in OpenSolaris */ if (iph1->natt_flags & NAT_KA_QUEUED) natt_keepalive_remove (iph1->local, iph1->remote); +#endif if (iph1->natt_options) { racoon_free(iph1->natt_options); @@ -470,8 +472,14 @@ struct ph2handle *p; LIST_FOREACH(p, &ph2tree, chain) { +#ifdef sun + if ((p->selector->sl_index == selector->sl_index || + rc_vmemcmp(p->selector->sl_index, + selector->sl_index) == 0) && +#else if (rc_vmemcmp(p->selector->sl_index, selector->sl_index) == 0 && +#endif CMPSADDR(src, p->src) == 0 && CMPSADDR(dst, p->dst) == 0) return p; @@ -629,6 +637,16 @@ racoon_free(iph2->dst_id); iph2->dst_id = NULL; } +#ifdef ENABLE_NATT + if (iph2->natoa_src) { + racoon_free(iph2->natoa_src); + iph2->natoa_src = NULL; + } + if (iph2->natoa_dst) { + racoon_free(iph2->natoa_dst); + iph2->natoa_dst = NULL; + } +#endif if (iph2->proposal) { flushsaprop(iph2->proposal); @@ -1488,6 +1506,8 @@ int satype; int retval; + (void) memset(¶m, 0, sizeof (param)); + switch (proto) { case IPSECDOI_PROTO_IPSEC_AH: satype = RCT_SATYPE_AH;