aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/lchan_fsm.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-10-10 01:53:34 +0200
committerHarald Welte <laforge@gnumonks.org>2018-10-12 06:21:35 +0000
commit0d91fb5ed14e1daf1a170429479f151a5e9206d2 (patch)
tree2035890f14219bab2a21a761b9e049ef739fe485 /src/osmo-bsc/lchan_fsm.c
parent8b818a01b00ea3daad4ad58c162ac52b4f08a5cb (diff)
lchan_fsm: fix failure handling: notify conn when released
Usually, conn->lchan is set to NULL before/upon releasing it. However, if the lchan is still associated with a conn upon/after release, make sure the conn realizes it has no lchan and sends a BSSMAP Clear Request to the MSC. lchan_reset() is the last step before an lchan is fully unused. In there, make sure to notify any conn that might still be associated, with gscon_forget_lchan(). lchan_cleanup() does the same, but in fact this is only called when an lchan is *deallocated*, but instead it usually merely goes to the UNUSED state. It may make sense to call gscon_forget_lchan() sooner, e.g. when entering a releasing state. This here nevertheless is a final safeguard. Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154 Change-Id: I88337a18246c44ba48da64bb611a3cbb647a750e
Diffstat (limited to 'src/osmo-bsc/lchan_fsm.c')
-rw-r--r--src/osmo-bsc/lchan_fsm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 4aaedde66..9f2d6c382 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -368,6 +368,9 @@ static void lchan_reset(struct gsm_lchan *lchan)
{
LOG_LCHAN(lchan, LOGL_DEBUG, "Clearing lchan state\n");
+ if (lchan->conn)
+ gscon_forget_lchan(lchan->conn, lchan);
+
if (lchan->rqd_ref) {
talloc_free(lchan->rqd_ref);
lchan->rqd_ref = NULL;