From 369fba25deb479dcac0e90ae7ce8af69f1b869bc Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 27 Nov 2018 01:30:50 +0100 Subject: send Immediate Assignment Reject only before Immediate Assignment Set flag lchan->activate.immediate_assignment_sent to true when sending, and omit a reject after that. lchan->activate gets completely zeroed in lchan_reset(), which sets that flag back to false whenever an lchan becomes inactive. Related: OS#3709 Change-Id: I9ad094d272254d7aee9b0a676201d4ed8cd727ca --- include/osmocom/bsc/gsm_data.h | 1 + src/osmo-bsc/lchan_fsm.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ba52c99b5..15158cdd0 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -501,6 +501,7 @@ struct gsm_lchan { struct { enum lchan_activate_mode activ_for; bool activ_ack; /*< true as soon as RSL Chan Activ Ack is received */ + bool immediate_assignment_sent; /*! This flag ensures that when an lchan activation has succeeded, and we have already * sent ACKs like Immediate Assignment or BSSMAP Assignment Complete, and if other errors * occur later, e.g. during release, that we don't send a NACK out of context. */ diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 71b40c117..5e99239c8 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -97,9 +97,17 @@ static void _lchan_on_activation_failure(struct gsm_lchan *lchan, enum lchan_act switch (activ_for) { case FOR_MS_CHANNEL_REQUEST: - LOG_LCHAN(lchan, LOGL_NOTICE, "Tx Immediate Assignment Reject (%s)\n", - lchan->last_error ? : "unknown error"); - rsl_tx_imm_ass_rej(lchan->ts->trx->bts, lchan->rqd_ref); + if (lchan->activate.immediate_assignment_sent) { + LOG_LCHAN(lchan, LOGL_ERROR, + "lchan activation failed, after Immediate Assignment message was sent (%s)\n", + lchan->last_error ? : "unknown error"); + /* Likely the MS never showed up. Just tear down the lchan. */ + } else { + /* Failure before Immediate Assignment message, send a reject. */ + LOG_LCHAN(lchan, LOGL_NOTICE, "Tx Immediate Assignment Reject (%s)\n", + lchan->last_error ? : "unknown error"); + rsl_tx_imm_ass_rej(lchan->ts->trx->bts, lchan->rqd_ref); + } break; case FOR_ASSIGNMENT: @@ -713,6 +721,7 @@ static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi) return; } LOG_LCHAN(lchan, LOGL_DEBUG, "Tx RR Immediate Assignment\n"); + lchan->activate.immediate_assignment_sent = true; break; case FOR_ASSIGNMENT: -- cgit v1.2.3