From d015cbd65d2547e813f361654b3059d4eefa3669 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 27 Feb 2017 17:58:31 +0100 Subject: XID: resend xid with pdp-ctx-ack messages If a pdp context is created a xid request is sent right after the pdp-context-ack message. The sending of the pdp-context-ack and the xid message is triggered from the GGSN via the GTP interface. When the pdp-context-ack message is not received by the MS, it will send the pdp-context-request again. A lost pdp-context-ack is resent by the SGSN directly so that the mechanism described above does not work for pdp-context-ack resents. This commit adds code to trigger the sending of xid messages also for resent pdp-context-ack messages. Change-Id: Ice66790803154310a61a70a54be76cec539c97a7 --- openbsc/src/gprs/gprs_gmm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 3f59a2b64..da243a4d5 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -68,6 +68,7 @@ #include #include #include +#include #include @@ -2438,6 +2439,7 @@ static int do_act_pdp_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, bool *del char apn_str[GSM_APN_LENGTH] = { 0, }; char *hostname; int rc; + struct gprs_llc_lle *lle; LOGMMCTXP(LOGL_INFO, mmctx, "-> ACTIVATE PDP CONTEXT REQ: SAPI=%u NSAPI=%u ", act_req->req_llc_sapi, act_req->req_nsapi); @@ -2513,7 +2515,19 @@ static int do_act_pdp_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, bool *del pdp->ti == transaction_id) { /* This apparently is a re-transmission of a PDP CTX * ACT REQ (our ACT ACK must have got dropped) */ - return gsm48_tx_gsm_act_pdp_acc(pdp); + rc = gsm48_tx_gsm_act_pdp_acc(pdp); + if (rc < 0) + return rc; + + if (pdp->mm->ran_type == MM_CTX_T_GERAN_Gb) { + /* Also re-transmit the SNDCP XID message */ + lle = &pdp->mm->gb.llme->lle[pdp->sapi]; + rc = sndcp_sn_xid_req(lle,pdp->nsapi); + if (rc < 0) + return rc; + } + + return 0; } /* Send reject with GSM_CAUSE_NSAPI_IN_USE */ -- cgit v1.2.3