aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/lchan_fsm.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-11-03 18:36:13 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2018-11-14 16:16:30 +0000
commit478e991a78c47988fdf2a667c6771ccd496e03a6 (patch)
tree02b8269cf63c664eb38dc9f250d6a4db5401ad14 /src/osmo-bsc/lchan_fsm.c
parent946d1fb5c7f4a593567b407222c9235f8fac7a59 (diff)
fix: send RR Release (e.g. after BSSMAP Clear Cmd)
After commit [1], the code makes sure to disassociate lchan and conn before invoking the lchan release. However, we only send RR Release if a conn is present, which clearly is nonsense after [1]. [1] commit 8b818a01b00ea3daad4ad58c162ac52b4f08a5cb "subscr conn: properly forget lchan before release" Change-Id: I4fd582b41ba4599af704d670af83651d2450b1db Manage sending of RR Release via a flag, set during invoking lchan release. Add do_rr_release arg to lchan_release(), gscon_release_lchans(). In lchan_fsm.c, send RR Release only if do_rr_release was passed true; do not care whether a conn is still associated (because it won't ever be since [1]). That way we can intelligently decide what release process makes sense (whether the lchan terminates the subscriber connection or whether the connection goes on at another lchan), and still disassociate lchan and conn early. BTW, this problem wasn't caught by the stock OsmoBSC TTCN3 tests, because the f_expect_chan_rel() don't care whether an RR Release happens or not. This is being fixed by Ibc64058f1e214bea585f4e8dcb66f3df8ead3845. So far this patch should fix BSC_Tests_LCLS.TC_lcls_connect_clear. Related: OS#3413 Change-Id: I666b3b4f45706d898d664d380bd0fd2b018be358
Diffstat (limited to 'src/osmo-bsc/lchan_fsm.c')
-rw-r--r--src/osmo-bsc/lchan_fsm.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 726a5bb15..39f29f2f7 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -156,14 +156,14 @@ static void lchan_on_fully_established(struct gsm_lchan *lchan)
LOG_LCHAN(lchan, LOGL_ERROR,
"lchan activation for assignment succeeded, but lchan has no conn:"
" cannot trigger appropriate actions. Release.\n");
- lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+ lchan_release(lchan, false, false, true, RSL_ERR_EQUIPMENT_FAIL);
break;
}
if (!lchan->conn->assignment.fi) {
LOG_LCHAN(lchan, LOGL_ERROR,
"lchan activation for assignment succeeded, but lchan has no"
" assignment ongoing: cannot trigger appropriate actions. Release.\n");
- lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+ lchan_release(lchan, false, false, true, RSL_ERR_EQUIPMENT_FAIL);
break;
}
osmo_fsm_inst_dispatch(lchan->conn->assignment.fi, ASSIGNMENT_EV_LCHAN_ESTABLISHED,
@@ -177,14 +177,14 @@ static void lchan_on_fully_established(struct gsm_lchan *lchan)
if (!lchan->conn) {
LOG_LCHAN(lchan, LOGL_ERROR,
"lchan activation for handover succeeded, but lchan has no conn\n");
- lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+ lchan_release(lchan, false, false, true, RSL_ERR_EQUIPMENT_FAIL);
break;
}
if (!lchan->conn->ho.fi) {
LOG_LCHAN(lchan, LOGL_ERROR,
"lchan activation for handover succeeded, but lchan has no"
" handover ongoing\n");
- lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+ lchan_release(lchan, false, false, true, RSL_ERR_EQUIPMENT_FAIL);
break;
}
osmo_fsm_inst_dispatch(lchan->conn->ho.fi, HO_EV_LCHAN_ESTABLISHED, lchan);
@@ -720,14 +720,14 @@ static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi)
LOG_LCHAN(lchan, LOGL_ERROR,
"lchan activation for assignment succeeded, but lchan has no conn:"
" cannot trigger appropriate actions. Release.\n");
- lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+ lchan_release(lchan, false, false, true, RSL_ERR_EQUIPMENT_FAIL);
break;
}
if (!lchan->conn->assignment.fi) {
LOG_LCHAN(lchan, LOGL_ERROR,
"lchan activation for assignment succeeded, but lchan has no"
" assignment ongoing: cannot trigger appropriate actions. Release.\n");
- lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+ lchan_release(lchan, false, false, true, RSL_ERR_EQUIPMENT_FAIL);
break;
}
/* After the Chan Activ Ack, the MS expects to receive an RR Assignment Command.
@@ -740,14 +740,14 @@ static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi)
LOG_LCHAN(lchan, LOGL_ERROR,
"lchan activation for handover succeeded, but lchan has no conn:"
" cannot trigger appropriate actions. Release.\n");
- lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+ lchan_release(lchan, false, false, true, RSL_ERR_EQUIPMENT_FAIL);
break;
}
if (!lchan->conn->ho.fi) {
LOG_LCHAN(lchan, LOGL_ERROR,
"lchan activation for handover succeeded, but lchan has no"
" handover ongoing: cannot trigger appropriate actions. Release.\n");
- lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL);
+ lchan_release(lchan, false, false, true, RSL_ERR_EQUIPMENT_FAIL);
break;
}
/* After the Chan Activ Ack of the new lchan, send the MS an RR Handover Command on the
@@ -937,7 +937,7 @@ static void lchan_fsm_wait_rll_rtp_released_onenter(struct osmo_fsm_inst *fi, ui
if (lchan->sapis[sapi])
LOG_LCHAN(lchan, LOGL_DEBUG, "SAPI[%d] = %d\n", sapi, lchan->sapis[sapi]);
- if (lchan->conn && lchan->sapis[0] != LCHAN_SAPI_UNUSED)
+ if (lchan->do_rr_release && lchan->sapis[0] != LCHAN_SAPI_UNUSED)
gsm48_send_rr_release(lchan);
if (lchan->fi_rtp)
@@ -1291,7 +1291,7 @@ int lchan_fsm_timer_cb(struct osmo_fsm_inst *fi)
}
}
-void lchan_release(struct gsm_lchan *lchan, bool sacch_deact,
+void lchan_release(struct gsm_lchan *lchan, bool sacch_deact, bool do_rr_release,
bool err, enum gsm48_rr_cause cause_rr)
{
if (!lchan || !lchan->fi)
@@ -1305,6 +1305,7 @@ void lchan_release(struct gsm_lchan *lchan, bool sacch_deact,
lchan->release_in_error = err;
lchan->rsl_error_cause = cause_rr;
lchan->deact_sacch = sacch_deact;
+ lchan->do_rr_release = do_rr_release;
/* States waiting for events will notice the desire to release when done waiting, so it is enough
* to mark for release. */