From 478e991a78c47988fdf2a667c6771ccd496e03a6 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 3 Nov 2018 18:36:13 +0100 Subject: 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 --- include/osmocom/bsc/bsc_subscr_conn_fsm.h | 2 +- include/osmocom/bsc/gsm_data.h | 1 + include/osmocom/bsc/lchan_fsm.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h index d4de1c975..fcdba503c 100644 --- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h +++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h @@ -71,7 +71,7 @@ void gscon_start_assignment(struct gsm_subscriber_connection *conn, struct assignment_request *req); void gscon_change_primary_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan *new_lchan); -void gscon_release_lchans(struct gsm_subscriber_connection *conn, bool do_sacch_deact); +void gscon_release_lchans(struct gsm_subscriber_connection *conn, bool do_sacch_deact, bool do_rr_release); void gscon_lchan_releasing(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); void gscon_forget_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 1be9ae8fb..5805a5f0c 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -514,6 +514,7 @@ struct gsm_lchan { * flag, so that the lchan will gracefully release at the next sensible junction. */ bool release_requested; bool deact_sacch; + bool do_rr_release; char *last_error; diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h index d2e872446..d3315a65e 100644 --- a/include/osmocom/bsc/lchan_fsm.h +++ b/include/osmocom/bsc/lchan_fsm.h @@ -49,7 +49,7 @@ enum lchan_fsm_event { void lchan_fsm_init(); void lchan_fsm_alloc(struct gsm_lchan *lchan); -void lchan_release(struct gsm_lchan *lchan, bool sacch_deact, +void lchan_release(struct gsm_lchan *lchan, bool do_deact_sacch, bool do_rr_release, bool err, enum gsm48_rr_cause cause_rr); struct lchan_activate_info { -- cgit v1.2.3