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/ipsecesp.c
          +++ new/usr/src/uts/common/inet/ip/ipsecesp.c
↓ open down ↓ 2810 lines elided ↑ open up ↑
2811 2811                  /*
2812 2812                   * Set the checksum to 0, so that the esp_prepare_udp() call
2813 2813                   * can do the right thing.
2814 2814                   */
2815 2815                  udpha->uha_checksum = 0;
2816 2816                  esph_ptr = (esph_t *)(udpha + 1);
2817 2817          }
2818 2818  
2819 2819          esph_ptr->esph_spi = assoc->ipsa_spi;
2820 2820  
2821      -        esph_ptr->esph_replay = htonl(atomic_add_32_nv(&assoc->ipsa_replay, 1));
     2821 +        esph_ptr->esph_replay = htonl(atomic_inc_32_nv(&assoc->ipsa_replay));
2822 2822          if (esph_ptr->esph_replay == 0 && assoc->ipsa_replay_wsize != 0) {
2823 2823                  /*
2824 2824                   * XXX We have replay counter wrapping.
2825 2825                   * We probably want to nuke this SA (and its peer).
2826 2826                   */
2827 2827                  ipsec_assocfailure(info.mi_idnum, 0, 0,
2828 2828                      SL_ERROR | SL_CONSOLE | SL_WARN,
2829 2829                      "Outbound ESP SA (0x%x, %s) has wrapped sequence.\n",
2830 2830                      esph_ptr->esph_spi, assoc->ipsa_dstaddr, af,
2831 2831                      espstack->ipsecesp_netstack);
↓ open down ↓ 1365 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX