diff options
Diffstat (limited to 'usr/src/uts/common/inet/ip/ipsecesp.c')
-rw-r--r-- | usr/src/uts/common/inet/ip/ipsecesp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr/src/uts/common/inet/ip/ipsecesp.c b/usr/src/uts/common/inet/ip/ipsecesp.c index 4b668c3866..df0752a174 100644 --- a/usr/src/uts/common/inet/ip/ipsecesp.c +++ b/usr/src/uts/common/inet/ip/ipsecesp.c @@ -2795,7 +2795,7 @@ inbound_task(void *arg) static int esp_add_sa_finish(mblk_t *mp, sadb_msg_t *samsg, keysock_in_t *ksi) { - isaf_t *primary, *secondary, *inbound; + isaf_t *primary, *secondary, *inbound, *outbound; sadb_sa_t *assoc = (sadb_sa_t *)ksi->ks_in_extv[SADB_EXT_SA]; sadb_address_t *dstext = (sadb_address_t *)ksi->ks_in_extv[SADB_EXT_ADDRESS_DST]; @@ -2828,14 +2828,17 @@ esp_add_sa_finish(mblk_t *mp, sadb_msg_t *samsg, keysock_in_t *ksi) dstaddr = (uint32_t *)(&dst6->sin6_addr); outhash = OUTBOUND_HASH_V6(sp, *(in6_addr_t *)dstaddr); } + inbound = INBOUND_BUCKET(sp, assoc->sadb_sa_spi); + outbound = &sp->sdb_of[outhash]; + switch (ksi->ks_in_dsttype) { case KS_IN_ADDR_MBCAST: clone = B_TRUE; /* All mcast SAs can be bidirectional */ /* FALLTHRU */ case KS_IN_ADDR_ME: primary = inbound; - secondary = &sp->sdb_of[outhash]; + secondary = outbound; /* * If the source address is either one of mine, or unspecified * (which is best summed up by saying "not 'not mine'"), @@ -2849,7 +2852,7 @@ esp_add_sa_finish(mblk_t *mp, sadb_msg_t *samsg, keysock_in_t *ksi) is_inbound = B_TRUE; break; case KS_IN_ADDR_NOTME: - primary = &sp->sdb_of[outhash]; + primary = outbound; secondary = inbound; /* * If the source address literally not mine (either |