Print this page
First attempt at further IPsec cluster cleanup

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/ip_sadb.c
          +++ new/usr/src/uts/common/inet/ip/ip_sadb.c
↓ open down ↓ 721 lines elided ↑ open up ↑
 722  722                  dst_ptr = (uint32_t *)&ipha->ipha_dst;
 723  723                  sp = &ahstack->ah_sadb.s_v4;
 724  724                  af = AF_INET;
 725  725          }
 726  726  
 727  727          hptr = INBOUND_BUCKET(sp, ah->ah_spi);
 728  728          mutex_enter(&hptr->isaf_lock);
 729  729          assoc = ipsec_getassocbyspi(hptr, ah->ah_spi, src_ptr, dst_ptr, af);
 730  730          mutex_exit(&hptr->isaf_lock);
 731  731  
 732      -        if (assoc == NULL || assoc->ipsa_state == IPSA_STATE_DEAD ||
 733      -            assoc->ipsa_state == IPSA_STATE_ACTIVE_ELSEWHERE) {
      732 +        if (assoc == NULL || assoc->ipsa_state == IPSA_STATE_DEAD) {
 734  733                  IP_AH_BUMP_STAT(ipss, lookup_failure);
 735  734                  IP_AH_BUMP_STAT(ipss, in_discards);
 736  735                  ipsecah_in_assocfailure(mp, 0,
 737  736                      SL_ERROR | SL_CONSOLE | SL_WARN,
 738  737                      "ipsec_inbound_ah_sa: No association found for "
 739  738                      "spi 0x%x, dst addr %s\n",
 740  739                      ah->ah_spi, dst_ptr, af, ira);
 741  740                  if (assoc != NULL) {
 742  741                          IPSA_REFRELE(assoc);
 743  742                  }
↓ open down ↓ 120 lines elided ↑ open up ↑
 864  863  
 865  864          esph = (esph_t *)(data_mp->b_rptr + preamble);
 866  865  
 867  866          /* Since hash is common on inbound (SPI value), hash here. */
 868  867          bucket = INBOUND_BUCKET(sp, esph->esph_spi);
 869  868          mutex_enter(&bucket->isaf_lock);
 870  869          ipsa = ipsec_getassocbyspi(bucket, esph->esph_spi, src_ptr, dst_ptr,
 871  870              af);
 872  871          mutex_exit(&bucket->isaf_lock);
 873  872  
 874      -        if (ipsa == NULL || ipsa->ipsa_state == IPSA_STATE_DEAD ||
 875      -            ipsa->ipsa_state == IPSA_STATE_ACTIVE_ELSEWHERE) {
      873 +        if (ipsa == NULL || ipsa->ipsa_state == IPSA_STATE_DEAD) {
 876  874                  /*  This is a loggable error!  AUDIT ME! */
 877  875                  IP_ESP_BUMP_STAT(ipss, lookup_failure);
 878  876                  IP_ESP_BUMP_STAT(ipss, in_discards);
 879  877                  ipsecesp_in_assocfailure(data_mp, 0,
 880  878                      SL_ERROR | SL_CONSOLE | SL_WARN,
 881  879                      "ipsec_inbound_esp_sa: No association found for "
 882  880                      "spi 0x%x, dst addr %s\n",
 883  881                      esph->esph_spi, dst_ptr, af, ira);
 884  882                  if (ipsa != NULL) {
 885  883                          IPSA_REFRELE(ipsa);
↓ open down ↓ 37 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX