From 801a2e5de72b9b8e499b1d43d1f6d6b419745203 Mon Sep 17 00:00:00 2001
From: calvin wang <calvin.wang@tcl.com>
Date: Thu, 12 Jan 2017 16:47:57 +0800
Subject: [PATCH] fix mistake bitwise operators

---
 openair3/NAS/COMMON/API/NETWORK/nas_message.c | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/openair3/NAS/COMMON/API/NETWORK/nas_message.c b/openair3/NAS/COMMON/API/NETWORK/nas_message.c
index f714af66f7..55adce8ea3 100644
--- a/openair3/NAS/COMMON/API/NETWORK/nas_message.c
+++ b/openair3/NAS/COMMON/API/NETWORK/nas_message.c
@@ -993,11 +993,11 @@ static int _nas_message_decrypt(
     case NAS_SECURITY_ALGORITHMS_EEA1: {
       if (direction == SECU_DIRECTION_UPLINK) {
         count = 0x00000000 |
-                ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) |
+                ((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
                 (emm_security_context->ul_count.seq_num & 0x000000FF);
       } else {
         count = 0x00000000 |
-                ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) |
+                ((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
                 (emm_security_context->dl_count.seq_num & 0x000000FF);
       }
 
@@ -1027,11 +1027,11 @@ static int _nas_message_decrypt(
     case NAS_SECURITY_ALGORITHMS_EEA2: {
       if (direction == SECU_DIRECTION_UPLINK) {
         count = 0x00000000 |
-                ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) |
+                ((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
                 (emm_security_context->ul_count.seq_num & 0x000000FF);
       } else {
         count = 0x00000000 |
-                ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) |
+                ((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
                 (emm_security_context->dl_count.seq_num & 0x000000FF);
       }
 
@@ -1155,11 +1155,11 @@ static int _nas_message_encrypt(
     case NAS_SECURITY_ALGORITHMS_EEA1: {
       if (direction == SECU_DIRECTION_UPLINK) {
         count = 0x00000000 |
-                ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) |
+                ((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
                 (emm_security_context->ul_count.seq_num & 0x000000FF);
       } else {
         count = 0x00000000 |
-                ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) |
+                ((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
                 (emm_security_context->dl_count.seq_num & 0x000000FF);
       }
 
@@ -1186,11 +1186,11 @@ static int _nas_message_encrypt(
     case NAS_SECURITY_ALGORITHMS_EEA2: {
       if (direction == SECU_DIRECTION_UPLINK) {
         count = 0x00000000 |
-                ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) |
+                ((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
                 (emm_security_context->ul_count.seq_num & 0x000000FF);
       } else {
         count = 0x00000000 |
-                ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) |
+                ((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
                 (emm_security_context->dl_count.seq_num & 0x000000FF);
       }
 
@@ -1300,11 +1300,11 @@ static uint32_t _nas_message_get_mac(
 
     if (direction == SECU_DIRECTION_UPLINK) {
       count = 0x00000000 |
-              ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) |
+              ((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
               (emm_security_context->ul_count.seq_num & 0x000000FF);
     } else {
       count = 0x00000000 |
-              ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) |
+              ((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
               (emm_security_context->dl_count.seq_num & 0x000000FF);
     }
 
@@ -1368,11 +1368,11 @@ static uint32_t _nas_message_get_mac(
 
     if (direction == SECU_DIRECTION_UPLINK) {
       count = 0x00000000 |
-              ((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) |
+              ((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
               (emm_security_context->ul_count.seq_num & 0x000000FF);
     } else {
       count = 0x00000000 |
-              ((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) |
+              ((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
               (emm_security_context->dl_count.seq_num & 0x000000FF);
     }
 
-- 
GitLab