From 0bab0007c7442d958be35b14f2dc07393a136e32 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 24 Jul 2024 19:29:15 +0200 Subject: [PATCH] gtp: Set Direct Tunnel Flags DTI during UpdatePDPCtx This is required as per TS 28.060 to tell the GGSN that the remote Address/TEID it is receiving it's the one of the RNC. Upon receiving a GTPU Error Indication, the GGSN knowing it's using DirectTunnel, can then update the SGSN with UpdatePDPContextReq with Direct Tunnel Flags DTI=1 EI=1 and then the SGSN can decide whether reconfigure the Direct Tunnel or switch to 2-leg tunnel until the connection with RNC/UE can be reestablished. Depends: osmo-ggsn.git Change-Id Ia3e360a35d30858eab1e438dc2508fd756c2e22e Related: SYS#5435 Change-Id: Iefe73eeea41df0c55db673194c9e9547504cbf0d --- TODO-RELEASE | 1 + src/sgsn/gprs_mm_state_iu_fsm.c | 3 +++ src/sgsn/gprs_ranap.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/TODO-RELEASE b/TODO-RELEASE index 0ed7189a4..79f557bec 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libgtp >1.12.0 new field dir_tun_flags in struct pdp_t diff --git a/src/sgsn/gprs_mm_state_iu_fsm.c b/src/sgsn/gprs_mm_state_iu_fsm.c index c2e9c4498..2bf356824 100644 --- a/src/sgsn/gprs_mm_state_iu_fsm.c +++ b/src/sgsn/gprs_mm_state_iu_fsm.c @@ -52,6 +52,9 @@ static void mmctx_change_gtpu_endpoints_to_sgsn(struct sgsn_mm_ctx *mm_ctx) LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s -> %s\n", sgsn_gtp_ntoa(&pdp->lib->gsnlu), inet_ntop(AF_INET, &sgsn->cfg.gtp_listenaddr.sin_addr, buf, sizeof(buf))); + /* Disable Direct Tunnel Flags DTI. Other flags make no sense here, so also set to 0. */ + pdp->lib->dir_tun_flags.l = 1; + pdp->lib->dir_tun_flags.v[0] = 0x00; sgsn_pdp_upd_gtp_u(pdp, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c index 5e0d8edc6..51954ce20 100644 --- a/src/sgsn/gprs_ranap.c +++ b/src/sgsn/gprs_ranap.c @@ -103,6 +103,8 @@ static int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrMod LOGP(DRANAP, LOGL_DEBUG, "Updating TEID on RNC side from 0x%08x to 0x%08x\n", pdp->lib->teid_own, tei); pdp->lib->teid_own = tei; + pdp->lib->dir_tun_flags.l = 1; + pdp->lib->dir_tun_flags.v[0] = 0x01; /* Set DTI flag in Direct Tunnel Flags */ require_pdp_update = true; }