gtp: Allow tx Direct Tunnel Flags in UpdatePDPCtx{Req,Resp}

In Update PDP Ctx Response, only SGSN is expected to transmit Direct
Tunnel Flags in the message.

Related: SYS#5435
Change-Id: I36d93619e2fe9cafd3092515df18b82d29099d2d
This commit is contained in:
Pau Espin Pedrol
2024-07-24 18:48:42 +02:00
parent 561a9bc77c
commit 7ce14f5e93
3 changed files with 18 additions and 0 deletions

View File

@@ -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 append new field dir_tun_flags in struct pdp_t (older users not using the field should be fine since struct pdp_t is allocated internally)

View File

@@ -1686,6 +1686,11 @@ int gtp_update_context(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp,
gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_OMC_ID,
pdp->omcid.l, pdp->omcid.v);
/* Direct Tunnel Flags */
if ((pdp->version == 1) && pdp->dir_tun_flags.l)
gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_DIR_TUN_FLAGS,
pdp->dir_tun_flags.l, pdp->dir_tun_flags.v);
gtp_req(gsn, pdp->version, pdp, &packet, length, inetaddr, cbp);
return 0;
@@ -1747,6 +1752,11 @@ static int gtp_update_pdp_resp(struct gsn_t *gsn, uint8_t version,
pdp->qos_neg.l, pdp->qos_neg.v);
/* TODO: Charging gateway address */
/* Direct Tunnel Flags */
if ((gsn->mode == GTP_MODE_SGSN) && (version == 1) && pdp->dir_tun_flags.l)
gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_DIR_TUN_FLAGS,
pdp->dir_tun_flags.l, pdp->dir_tun_flags.v);
}
return gtp_resp(version, gsn, pdp, &packet, length, peer,

View File

@@ -46,6 +46,11 @@ struct ul_t {
unsigned char *v;
};
struct ul1_t {
unsigned int l;
unsigned char v[1];
};
struct ul16_t {
unsigned int l;
unsigned char v[16];
@@ -244,6 +249,8 @@ struct pdp_t {
bool tx_gpdu_seq; /* Transmit (true) or suppress G-PDU sequence numbers */
struct llist_head qmsg_list_req; /* list of req qmsg_t in retrans queue belonging this pdp ctx */
struct ul1_t dir_tun_flags; /* Direct Tunnel Flags, TS 29.060 7.7.81 */
};
/* functions related to pdp_t management */