Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/ipsecah.c
          +++ new/usr/src/uts/common/inet/ip/ipsecah.c
↓ open down ↓ 2566 lines elided ↑ open up ↑
2567 2567          bzero(phdr_ah + 1, ah_data_sz); /* Zero out ICV for pseudo-hdr. */
2568 2568  
2569 2569          if (inbound_ah == NULL) {
2570 2570                  /* Outbound AH datagram. */
2571 2571  
2572 2572                  phdr_ah->ah_length = (ah_align_sz >> 2) + 1;
2573 2573                  phdr_ah->ah_reserved = 0;
2574 2574                  phdr_ah->ah_spi = assoc->ipsa_spi;
2575 2575  
2576 2576                  phdr_ah->ah_replay =
2577      -                    htonl(atomic_add_32_nv(&assoc->ipsa_replay, 1));
     2577 +                    htonl(atomic_inc_32_nv(&assoc->ipsa_replay));
2578 2578                  if (phdr_ah->ah_replay == 0 && assoc->ipsa_replay_wsize != 0) {
2579 2579                          /*
2580 2580                           * XXX We have replay counter wrapping.  We probably
2581 2581                           * want to nuke this SA (and its peer).
2582 2582                           */
2583 2583                          ipsec_assocfailure(info.mi_idnum, 0, 0,
2584 2584                              SL_ERROR | SL_CONSOLE | SL_WARN,
2585 2585                              "Outbound AH SA (0x%x), dst %s has wrapped "
2586 2586                              "sequence.\n", phdr_ah->ah_spi,
2587 2587                              assoc->ipsa_dstaddr, assoc->ipsa_addrfam,
↓ open down ↓ 1425 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX