From 3b6da3ddb2d03b053ed58b8191cefda309956130 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 24 Feb 2022 15:38:52 +0100 Subject: [PATCH] [GTPv1C] Fix sequm not added to EchoResponse and VersionNotSupported (#1390) According to TS 29.060 they should be added. section 7.6: "if it is a request for which a response has been defined, shall be sent with a Sequence Number" section 8.2: """ Sequence number flag (S) shall be set to "1" ... For GTP-C messages not having a defined response message for a request message, i.e. for messages Version Not Supported, RAN Information Relay and Supported Extension Headers Notification, the Sequence Number shall be ignored by the receiver. " --- lib/gtp/xact.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/gtp/xact.c b/lib/gtp/xact.c index 185e42c3a0..33c6d0d747 100644 --- a/lib/gtp/xact.c +++ b/lib/gtp/xact.c @@ -306,11 +306,8 @@ int ogs_gtp1_xact_update_tx(ogs_gtp_xact_t *xact, return OGS_ERROR; } - if (hdesc->type > OGS_GTP1_VERSION_NOT_SUPPORTED_TYPE) { - gtp_hlen = OGS_GTPV1C_HEADER_LEN; - } else { - gtp_hlen = OGS_GTPV1C_HEADER_LEN - 4; - } + gtp_hlen = OGS_GTPV1C_HEADER_LEN; + ogs_pkbuf_push(pkbuf, gtp_hlen); h = (ogs_gtp1_header_t *)pkbuf->data; @@ -321,10 +318,8 @@ int ogs_gtp1_xact_update_tx(ogs_gtp_xact_t *xact, h->pt = 1; /* GTP */ h->teid = htobe32(hdesc->teid); - if (hdesc->type > OGS_GTP1_VERSION_NOT_SUPPORTED_TYPE) { - h->s = 1; - h->sqn = OGS_GTP1_XID_TO_SQN(xact->xid); - } + h->s = 1; + h->sqn = OGS_GTP1_XID_TO_SQN(xact->xid); h->length = htobe16(pkbuf->len - 8); /* Save Message type and packet of this step */