aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/bsc_subscr_conn_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/bsc_subscr_conn_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/bsc_subscr_conn_fsm.c')
-rw-r--r--src/osmo-bsc/bsc_subscr_conn_fsm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 4d6521f83..5856d7abd 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -152,7 +152,7 @@ static void forward_dtap(struct gsm_subscriber_connection *conn, struct msgb *ms
/* Release an lchan in such a way that it doesn't fire events back to the conn. */
static void gscon_release_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan,
- bool do_sacch_deact, bool err, enum gsm48_rr_cause cause_rr)
+ bool do_sacch_deact, bool do_rr_release, bool err, enum gsm48_rr_cause cause_rr)
{
if (!lchan || !conn)
return;
@@ -164,17 +164,17 @@ static void gscon_release_lchan(struct gsm_subscriber_connection *conn, struct g
conn->ho.new_lchan = NULL;
if (conn->assignment.new_lchan == lchan)
conn->assignment.new_lchan = NULL;
- lchan_release(lchan, do_sacch_deact, err, cause_rr);
+ lchan_release(lchan, do_sacch_deact, do_rr_release, err, cause_rr);
}
-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)
{
if (conn->ho.fi)
handover_end(conn, HO_RESULT_CONN_RELEASE);
assignment_reset(conn);
- gscon_release_lchan(conn, conn->lchan, do_sacch_deact, false, 0);
+ gscon_release_lchan(conn, conn->lchan, do_sacch_deact, do_rr_release, false, 0);
}
static void handle_bssap_n_connect(struct osmo_fsm_inst *fi, struct osmo_scu_prim *scu_prim)
@@ -620,7 +620,7 @@ void gscon_change_primary_lchan(struct gsm_subscriber_connection *conn, struct g
osmo_fsm_inst_dispatch(conn->lchan->fi_rtp, LCHAN_RTP_EV_ESTABLISHED, 0);
if (old_lchan && (old_lchan != new_lchan))
- gscon_release_lchan(conn, old_lchan, false, false, 0);
+ gscon_release_lchan(conn, old_lchan, false, false, false, 0);
}
void gscon_lchan_releasing(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan)
@@ -716,7 +716,7 @@ static void gscon_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *d
if (conn->fi->state != ST_CLEARING)
osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999);
LOGPFSML(fi, LOGL_DEBUG, "Releasing all lchans (if any) after BSSMAP Clear Command\n");
- gscon_release_lchans(conn, true);
+ gscon_release_lchans(conn, true, true);
/* FIXME: Release all terestrial resources in ST_CLEARING */
/* According to 3GPP 48.008 3.1.9.1. "The BSS need not wait for the radio channel
* release to be completed or for the guard timer to expire before returning the
@@ -792,7 +792,7 @@ static void gscon_pre_term(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause ca
}
LOGPFSML(fi, LOGL_DEBUG, "Releasing all lchans (if any) because this conn is terminating\n");
- gscon_release_lchans(conn, false);
+ gscon_release_lchans(conn, false, true);
/* drop pending messages */
gscon_dtap_queue_flush(conn, 0);
@@ -806,7 +806,7 @@ static int gscon_timer_cb(struct osmo_fsm_inst *fi)
switch (fi->T) {
case 993210:
- gscon_release_lchan(conn, conn->lchan, false, true, RSL_ERR_INTERWORKING);
+ gscon_release_lchan(conn, conn->lchan, false, true, true, RSL_ERR_INTERWORKING);
/* MSC has not responded/confirmed connection with CC, this
* could indicate a bad SCCP connection. We now inform the the