override protected PeerSecAssociation CreateSecurityAssociation(ISender sender, int spi, bool start)
{
PeerSecAssociation sa = null;
lock(_sync) {
sa = base.CreateSecurityAssociation(sender, spi, start);
AHSender ahsender = sender as AHSender;
if(ahsender != null) {
Address target = ahsender.Destination;
if(_address_to_sa.ContainsKey(target)) {
sa = _address_to_sa[target] as PeerSecAssociation;
} else {
sa = base.CreateSecurityAssociation(sender, spi, start);
_address_to_sa[target] = sa;
_sa_to_address[sa] = target;
}
}
}
return sa;
}