From c9cd6bb78601780b49ea4c4c3db118aa0f5727e3 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 4 Sep 2019 12:57:44 +0200 Subject: a_reset.c: Don't wait 2 seconds to send first BSSMAP RESET Function fsm_reset_ack_timeout_cb() could be called directly from within a_reset_alloc(), but it's still desirable to deferr the BSSMAP RESET to be sent asynchronously by the timer upon next main loop step as soon as possible, so whole process is already configured properly. 1ms needs to be set instead of 0 (immediate asynchronous) because value 0 actually disables the timer. As a result, moving the state_chg() after the msc->a.reset_fsm assignment is not really needed, but still makes it more clear that the pointer will be set upon call of the timer callback. Related: OS#4188 Change-Id: I68d76a4050d4dec7d53b0031d67e0dd35ddd8764 --- src/osmo-bsc/a_reset.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/osmo-bsc') diff --git a/src/osmo-bsc/a_reset.c b/src/osmo-bsc/a_reset.c index fc59ff4da..b75272fd1 100644 --- a/src/osmo-bsc/a_reset.c +++ b/src/osmo-bsc/a_reset.c @@ -161,11 +161,10 @@ void a_reset_alloc(struct bsc_msc_data *msc, const char *name, void *cb) reset_ctx->conn_loss_counter = 0; reset_fsm = osmo_fsm_inst_alloc(&fsm, msc, reset_ctx, LOGL_DEBUG, name); OSMO_ASSERT(reset_fsm); - - /* kick off reset-ack sending mechanism */ - osmo_fsm_inst_state_chg(reset_fsm, ST_DISC, RESET_RESEND_INTERVAL, RESET_RESEND_TIMER_NO); - msc->a.reset_fsm = reset_fsm; + + /* Immediatelly (1ms) kick off reset sending mechanism */ + osmo_fsm_inst_state_chg_ms(reset_fsm, ST_DISC, 1, RESET_RESEND_TIMER_NO); } /* Confirm that we sucessfully received a reset acknowlege message */ -- cgit v1.2.3