From feaa86fc9c55acf818c7eb66563945f07be6d861 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 15 Jan 2024 16:25:43 +0100 Subject: [PATCH] [GTPv1] Fix encoding of MM Context IE if NRSNRA bit not set The len byte, describing the length of the field coming after it, is always expected according to the struct definition. --- lib/gtp/v1/types.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gtp/v1/types.c b/lib/gtp/v1/types.c index 17667d391..eb7541895 100644 --- a/lib/gtp/v1/types.c +++ b/lib/gtp/v1/types.c @@ -504,6 +504,9 @@ int ogs_gtp1_build_mm_context(ogs_gtp1_tlv_mm_context_t *octet, CHECK_SPACE_ERR(2); *ptr++ = 1; *ptr++ = 0x01; + } else { + CHECK_SPACE_ERR(1); + *ptr++ = 0; } octet->len = (ptr - data);