From 7e33d11c3dbfdb7777453060f5c35c7964108bb1 Mon Sep 17 00:00:00 2001 From: matzakos Date: Wed, 3 Jun 2020 11:23:28 +0200 Subject: [PATCH] Change NR PDCP SN field to 18 instead of 12 bits length -Required because the 12 bits SN is not accepted from the phone --- openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c index c25f28aae8..85f638d66d 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c @@ -32,7 +32,7 @@ void nr_pdcp_entity_drb_am_recv_pdu(nr_pdcp_entity_t *_entity, char *buffer, int if (size < 3) abort(); if (!(buffer[0] & 0x80)) { printf("%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); exit(1); } entity->common.deliver_sdu(entity->common.deliver_sdu_data, - (nr_pdcp_entity_t *)entity, buffer+2, size-2); + (nr_pdcp_entity_t *)entity, buffer+3, size-3); } void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int size, @@ -50,12 +50,13 @@ void nr_pdcp_entity_drb_am_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int entity->common.tx_hfn++; } - buf[0] = 0x80 | ((sn >> 8) & 0x0f); - buf[1] = sn & 0xff; - memcpy(buf+2, buffer, size); + buf[0] = 0x80 | ((sn >> 16) & 0x3); + buf[1] = (sn >> 8) & 0xff; + buf[2] = sn & 0xff; + memcpy(buf+3, buffer, size); entity->common.deliver_pdu(entity->common.deliver_pdu_data, - (nr_pdcp_entity_t *)entity, buf, size+2, sdu_id); + (nr_pdcp_entity_t *)entity, buf, size+3, sdu_id); } void nr_pdcp_entity_drb_am_set_integrity_key(nr_pdcp_entity_t *_entity, char *key)