diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-06-08 18:08:59 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-09 21:40:45 +0800 |
commit | 60ebc02ba8c31ae0a2b1163f2bef4b21c8ebfde9 (patch) | |
tree | 5ccca25201727c4c918e49151b1baf36ca6312d4 | |
parent | 0897dad30025eb2f840ffbbfd307843fdba47e5f (diff) |
[GPRS] SM: Acknowledge PDP CTX DEACT for non-existing PDP CTX
Some phones (notably a Ericsson Mobile Platform based E-TEN M800)
insist on sending PDP CTX DEACT messages for contexts that have already
been deactivated. The spec doesn't really say what we should do in
this case. But since there is no "reject", we simply acknowledge it.
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index ed9f40357..bbbbf4bc8 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -918,21 +918,25 @@ int gsm48_tx_gsm_act_pdp_rej(struct sgsn_mm_ctx *mm, uint8_t tid, } /* Section 9.5.9: Deactivate PDP Context Accept */ -int gsm48_tx_gsm_deact_pdp_acc(struct sgsn_pdp_ctx *pdp) +static int _gsm48_tx_gsm_deact_pdp_acc(struct sgsn_mm_ctx *mm, uint8_t tid) { struct msgb *msg = gsm48_msgb_alloc(); struct gsm48_hdr *gh; - uint8_t transaction_id = pdp->ti ^ 0x8; /* flip */ + uint8_t transaction_id = tid ^ 0x8; /* flip */ DEBUGP(DMM, "<- DEACTIVATE PDP CONTEXT ACK\n"); - mmctx2msgid(msg, pdp->mm); + mmctx2msgid(msg, mm); gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); gh->proto_discr = GSM48_PDISC_SM_GPRS | (transaction_id << 4); gh->msg_type = GSM48_MT_GSM_DEACT_PDP_ACK; - return gsm48_gmm_sendmsg(msg, 0, pdp->mm); + return gsm48_gmm_sendmsg(msg, 0, mm); +} +int gsm48_tx_gsm_deact_pdp_acc(struct sgsn_pdp_ctx *pdp) +{ + return _gsm48_tx_gsm_deact_pdp_acc(pdp->mm, pdp->ti); } /* Section 9.5.1: Activate PDP Context Request */ @@ -1055,7 +1059,7 @@ static int gsm48_rx_gsm_deact_pdp_req(struct sgsn_mm_ctx *mm, struct msgb *msg) LOGP(DMM, LOGL_NOTICE, "Deactivate PDP Context Request for " "non-existing PDP Context (IMSI=%s, TI=%u)\n", mm->imsi, transaction_id); - return -EINVAL; + return _gsm48_tx_gsm_deact_pdp_acc(mm, transaction_id); } return sgsn_delete_pdp_ctx(pdp); |