From 628a05e738b5f37e2fecd544780240e56db54036 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 7 Aug 2018 11:31:51 +0200 Subject: 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 --- include/osmocom/bsc/a_reset.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include/osmocom') diff --git a/include/osmocom/bsc/a_reset.h b/include/osmocom/bsc/a_reset.h index 6b6ce814a..a09972e18 100644 --- a/include/osmocom/bsc/a_reset.h +++ b/include/osmocom/bsc/a_reset.h @@ -20,17 +20,19 @@ #pragma once +struct bsc_msc_data; + /* Create and start state machine which handles the reset/reset-ack procedure */ -struct osmo_fsm_inst *a_reset_alloc(void *ctx, const char *name, void *cb, void *priv); +void a_reset_alloc(struct bsc_msc_data *msc, const char *name, void *cb); /* Confirm that we sucessfully received a reset acknowlege message */ -void a_reset_ack_confirm(struct osmo_fsm_inst *reset_fsm); +void a_reset_ack_confirm(struct bsc_msc_data *msc); /* Report a failed connection */ -void a_reset_conn_fail(struct osmo_fsm_inst *reset_fsm); +void a_reset_conn_fail(struct bsc_msc_data *msc); /* Report a successful connection */ -void a_reset_conn_success(struct osmo_fsm_inst *reset_fsm); +void a_reset_conn_success(struct bsc_msc_data *msc); /* Check if we have a connection to a specified msc */ -bool a_reset_conn_ready(struct osmo_fsm_inst *reset_fsm); +bool a_reset_conn_ready(struct bsc_msc_data *msc); -- cgit v1.2.3