diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-08-07 11:31:51 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-08-07 15:11:41 +0000 |
commit | 628a05e738b5f37e2fecd544780240e56db54036 (patch) | |
tree | 6f6d89d30b77177980ed5a01c00057dc6f05d32a /src/osmo-bsc/bsc_subscr_conn_fsm.c | |
parent | bf4e29a7dff6e3b5ce9e4da150b8b1dfce86be83 (diff) |
GSCON: call api of a_reset.c with msc object directly
The API of a_reset.c is currently called with a pointer to struct
reset_ctx. This puts the responsibility of checking the presence of
msc->a.reset_fsm to the caller. It would be much more effective if the
caller would check if msc->a.reset_fsm before dereferencing it.
This also fixes at least one segfault that ocurrs when gscon_timer_cb()
is called but no sccp connection is present yet. Therefore the pointer
to bsc_msc_data would not be populated. This is now detected by
a_reset.c itsself.
- minor code cleanups
- call a_reset.c functions with msc (struct bsc_msc_data)
Change-Id: I0802aaadf0af4e58e41c98999e8c6823838adb61
Related: OS#3447
Diffstat (limited to 'src/osmo-bsc/bsc_subscr_conn_fsm.c')
-rw-r--r-- | src/osmo-bsc/bsc_subscr_conn_fsm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 81fe9f6cc..32375d47f 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -771,7 +771,7 @@ static int gscon_timer_cb(struct osmo_fsm_inst *fi) * could indicate a bad SCCP connection. We now inform the the * FSM that controls the BSSMAP reset about the event. Maybe * a BSSMAP reset is necessary. */ - a_reset_conn_fail(conn->sccp.msc->a.reset_fsm); + a_reset_conn_fail(conn->sccp.msc); /* Since we could not reach the MSC, we give up and terminate * the FSM instance now (N-DISCONNET.req is sent in @@ -783,7 +783,7 @@ static int gscon_timer_cb(struct osmo_fsm_inst *fi) * disconnected. */ LOGPFSML(fi, LOGL_ERROR, "Long after a BSSMAP Clear Command, the conn is still not" " released. For sanity, discarding this conn now.\n"); - a_reset_conn_fail(conn->sccp.msc->a.reset_fsm); + a_reset_conn_fail(conn->sccp.msc); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); break; default: |