sgsn: Only send Detach Accept (MO) if power_off isn't set

Currently, every time the SGSN received a Detach Request from the MS
via an established logical link, it is answered by a Detach Accept.
This violates the specification (GSM 04.08, 4.7.4.1.2 and .3), which
states, that it should only be sent, if "the detach type IE value
indicates that the detach request has not been sent due to switching
off".

This patch adds a conditional to limit the sending of Detach Accept
accordingly.

Sponsored-by: On-Waves ehf
This commit is contained in:
Jacob Erlbeck 2014-10-21 09:52:05 +02:00 committed by Holger Hans Peter Freyther
parent 189999d654
commit b9ab0d4f39
2 changed files with 7 additions and 3 deletions

View File

@ -875,8 +875,12 @@ static int gsm48_rx_gmm_det_req(struct sgsn_mm_ctx *ctx, struct msgb *msg)
msgb_tlli(msg), get_value_string(gprs_det_t_mo_strs, detach_type),
power_off ? "Power-off" : "");
/* force_stby = 0 */
rc = gsm48_tx_gmm_det_ack(ctx, 0);
/* Only sent the Detach Accept (MO) if power off isn't indicated,
* see 04.08, 4.7.4.1.2/3 for details */
if (!power_off) {
/* force_stby = 0 */
rc = gsm48_tx_gmm_det_ack(ctx, 0);
}
mm_ctx_cleanup_free(ctx, "GPRS DETACH REQUEST");

View File

@ -213,7 +213,7 @@ static void test_gmm_detach_power_off(void)
/* verify that no message (and therefore no Detach Accept) has been
* sent by the SGSN */
/* OSMO_ASSERT(sgsn_tx_counter_old == sgsn_tx_counter); */
OSMO_ASSERT(sgsn_tx_counter_old == sgsn_tx_counter);
/* verify that things are gone */
OSMO_ASSERT(count(gprs_llme_list()) == 0);