diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index db0c2dbf7..ff852eb80 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -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"); diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 00ee86679..cb3c29472 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -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);