From c957e116820723532473002657271b9f4f720a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Soares=20Silva?= Date: Fri, 22 Aug 2025 15:17:47 +0100 Subject: [PATCH 1/3] Change last_idx type to int16 to properly avoid unpacking if the tlv length is 0 --- nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c b/nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c index fa0ed1bd8f..befd2c9dd3 100644 --- a/nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c +++ b/nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c @@ -2308,7 +2308,7 @@ uint8_t unpack_nr_srs_report_tlv_value(nfapi_srs_report_tlv_t *report_tlv, uint8 } } #else - const uint16_t last_idx = ((report_tlv->length + 3) / 4) - 1; + const int16_t last_idx = ((report_tlv->length + 3) / 4) - 1; for (int i = 0; i < last_idx; i++) { if (!pull32(ppReadPackedMsg, &report_tlv->value[i], end)) { return 0; From f1fbf4aa29d78ecd2902f22ea302ea80ace0ae73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Soares=20Silva?= Date: Fri, 22 Aug 2025 15:22:05 +0100 Subject: [PATCH 2/3] Skip unpacking SRS.indication TLV when report type is 0 Move the check for timing advance offset being 0xffff to before locking the scheduler --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 4486be536d..b4ab184deb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1498,8 +1498,17 @@ void handle_nr_srs_measurements(const module_id_t module_id, nfapi_nr_srs_indication_pdu_t *srs_ind) { gNB_MAC_INST *nrmac = RC.nrmac[module_id]; - NR_SCHED_LOCK(&nrmac->sched_lock); LOG_D(NR_MAC, "(%d.%d) Received SRS indication for UE %04x\n", frame, slot, srs_ind->rnti); + if (srs_ind->report_type == 0) { + //SCF 222.10.04 Table 3-129 Report type = 0 means a null report, we can skip unpacking it + return; + } + + if (srs_ind->timing_advance_offset == 0xFFFF) { + LOG_W(NR_MAC, "Invalid timing advance offset for RNTI %04x\n", srs_ind->rnti); + return; + } + NR_SCHED_LOCK(&nrmac->sched_lock); #ifdef SRS_IND_DEBUG LOG_I(NR_MAC, "frame = %i\n", frame); @@ -1518,12 +1527,6 @@ void handle_nr_srs_measurements(const module_id_t module_id, return; } - if (srs_ind->timing_advance_offset == 0xFFFF) { - LOG_W(NR_MAC, "Invalid timing advance offset for RNTI %04x\n", srs_ind->rnti); - NR_SCHED_UNLOCK(&nrmac->sched_lock); - return; - } - gNB_MAC_INST *nr_mac = RC.nrmac[module_id]; NR_mac_stats_t *stats = &UE->mac_stats; nfapi_srs_report_tlv_t *report_tlv = &srs_ind->report_tlv; From 0ebb97c4aed63fe9acf74811faf86ae60af0a7a0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 26 Aug 2025 08:45:57 +0200 Subject: [PATCH 3/3] nfapi.md: fix link to current document --- doc/nfapi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/nfapi.md b/doc/nfapi.md index 73aaf2e770..214aa2799f 100644 --- a/doc/nfapi.md +++ b/doc/nfapi.md @@ -171,7 +171,7 @@ After installing WLS, you can run the build command as shown below: #### How to run OAI PNF with OAI VNF -Refer to the above steps in [Quickstart](.#quickstart), but run the PNF first as it is the WLS "master". +Refer to the above steps in [Quickstart](#quickstart), but run the PNF first as it is the WLS "master". #### How to run OAI PNF with OSC/Radisys O-DU