diff options
Diffstat (limited to 'src/plugins/nat/nat_det.h')
-rw-r--r-- | src/plugins/nat/nat_det.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/nat/nat_det.h b/src/plugins/nat/nat_det.h index ce876bca9fb..7878a4c4ed6 100644 --- a/src/plugins/nat/nat_det.h +++ b/src/plugins/nat/nat_det.h @@ -159,13 +159,13 @@ snat_det_ses_create (snat_det_map_t * dm, ip4_address_t * in_addr, { if (!dm->sessions[i + user_offset].in_port) { - if (__sync_bool_compare_and_swap + if (clib_atomic_bool_cmp_and_swap (&dm->sessions[i + user_offset].in_port, 0, in_port)) { dm->sessions[i + user_offset].out.as_u64 = out->as_u64; dm->sessions[i + user_offset].state = SNAT_SESSION_UNKNOWN; dm->sessions[i + user_offset].expire = 0; - __sync_add_and_fetch (&dm->ses_num, 1); + clib_atomic_add_fetch (&dm->ses_num, 1); return &dm->sessions[i + user_offset]; } } @@ -179,10 +179,10 @@ snat_det_ses_create (snat_det_map_t * dm, ip4_address_t * in_addr, always_inline void snat_det_ses_close (snat_det_map_t * dm, snat_det_session_t * ses) { - if (__sync_bool_compare_and_swap (&ses->in_port, ses->in_port, 0)) + if (clib_atomic_bool_cmp_and_swap (&ses->in_port, ses->in_port, 0)) { ses->out.as_u64 = 0; - __sync_add_and_fetch (&dm->ses_num, -1); + clib_atomic_add_fetch (&dm->ses_num, -1); } } |