Commit f5aaacd9 authored by Guido Casati's avatar Guido Casati Committed by Guido Casati

RRCReestablishmentRequest: replace random value magic number with constant

Replace the magic number 0x7fffffffff used for masking 39-bit random
values with a named constant NR_RRC_RANDOM_VALUE_39_BIT_MASK defined
in nr_rrc_defs.h.

Refs:
- TS 38.331 5.3.3.3: Random UE identity (39-bit values)
Signed-off-by: default avatarGuido Casati <guido.casati@openairinterface.org>
parent cde7d98a
...@@ -101,6 +101,9 @@ mui_t rrc_gNB_mui = 0; ...@@ -101,6 +101,9 @@ mui_t rrc_gNB_mui = 0;
#define NR_C_RNTI_MIN 0x0001 #define NR_C_RNTI_MIN 0x0001
#define NR_C_RNTI_MAX 0xfff2 #define NR_C_RNTI_MAX 0xfff2
/* 5.3.3.3 TS 38.331: Random UE identity mask for 39-bit values */
#define NR_RRC_RANDOM_VALUE_39_BIT_MASK (0x7fffffffffULL)
/** @brief clone and re-enqueue an NGAP message after delaying /** @brief clone and re-enqueue an NGAP message after delaying
* delays the ongoing transaction (in msg_p) by setting a timer to wait * delays the ongoing transaction (in msg_p) by setting a timer to wait
* 10ms; upon expiry, delivers to RRC, which sends the message to itself */ * 10ms; upon expiry, delivers to RRC, which sends the message to itself */
...@@ -1644,7 +1647,7 @@ static void rrc_handle_RRCReestablishmentRequest(gNB_RRC_INST *rrc, ...@@ -1644,7 +1647,7 @@ static void rrc_handle_RRCReestablishmentRequest(gNB_RRC_INST *rrc,
fallback_rrc_setup: fallback_rrc_setup:
fill_random(&random_value, sizeof(random_value)); fill_random(&random_value, sizeof(random_value));
random_value = random_value & 0x7fffffffff; /* random value is 39 bits */ random_value = random_value & NR_RRC_RANDOM_VALUE_39_BIT_MASK;
ngap_cause_t cause = {.type = NGAP_CAUSE_RADIO_NETWORK, .value = ngap_cause}; ngap_cause_t cause = {.type = NGAP_CAUSE_RADIO_NETWORK, .value = ngap_cause};
/* request release of the "old" UE in case it exists */ /* request release of the "old" UE in case it exists */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment