From a55c4cdca571d783243f2bec8f74d1c588387543 Mon Sep 17 00:00:00 2001 From: Francisco Date: Fri, 29 Jan 2021 11:27:54 +0000 Subject: [PATCH] avoid gtpu extension header pdcp number magic number --- lib/src/upper/gtpu.cc | 2 +- srsenb/src/stack/upper/gtpu.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/upper/gtpu.cc b/lib/src/upper/gtpu.cc index c0a309ed6..729ceac0c 100644 --- a/lib/src/upper/gtpu.cc +++ b/lib/src/upper/gtpu.cc @@ -132,7 +132,7 @@ bool gtpu_read_header(srslte::byte_buffer_t* pdu, gtpu_header_t* header, srslte: header->next_ext_hdr_type = *ptr; ptr++; - if ((header->flags & GTPU_FLAGS_EXTENDED_HDR) && (header->next_ext_hdr_type == 0b11000000)) { + if ((header->flags & GTPU_FLAGS_EXTENDED_HDR) && (header->next_ext_hdr_type == GTPU_EXT_HEADER_PDCP_PDU_NUMBER)) { header->ext_buffer.resize(4); for (size_t i = 0; i < 4; ++i) { header->ext_buffer[i] = *ptr; diff --git a/srsenb/src/stack/upper/gtpu.cc b/srsenb/src/stack/upper/gtpu.cc index c4ebf39b6..22f66d186 100644 --- a/srsenb/src/stack/upper/gtpu.cc +++ b/srsenb/src/stack/upper/gtpu.cc @@ -128,7 +128,7 @@ void gtpu::send_pdu_to_tunnel(uint16_t rnti, if (pdcp_sn >= 0) { header.flags |= GTPU_FLAGS_EXTENDED_HDR; - header.next_ext_hdr_type = 0b11000000; + header.next_ext_hdr_type = GTPU_EXT_HEADER_PDCP_PDU_NUMBER; header.ext_buffer.resize(4u); header.ext_buffer[0] = 0x01u; header.ext_buffer[1] = (pdcp_sn >> 8u) & 0xffu;