From cd3d71b31885a8e05096de0bc0711d3c615e8d47 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 15 Sep 2022 18:53:07 +0200 Subject: abis: Avoid TCP/IPA RSL sockets continue conn establishment while shutting down when something fails in osmo-bts during startup and it goes into SHUTDOWN state, it is desirable to close new RSL links (sockets) which are in progress to connect, while it waits for a while to complete shutdown (power ramping down, etc.). This way we don't end up with new interactions and new state against a BSC if we are shutting down. The new libosmo-abis API is used since the higher layer struct e1inp_sign_link assigned to each struct gsm_bts_trx is not provided to the osmo-bts code layer by libosmo-abis API until the TCP+IPA handshake in the socket becomes fully established (sign_link_up() callback). Depends: libosmo-abis.git Ia6418321f3b6f1f7274efd414625a4b10a09a362 Change-Id: I599d074f51f490b43c9a89b105d1823391926947 --- src/common/abis.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/common/abis.c') diff --git a/src/common/abis.c b/src/common/abis.c index 4afe81af..10eeafff 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -230,6 +230,14 @@ static void abis_link_connected(struct osmo_fsm_inst *fi, uint32_t event, void * trx->rsl_link = NULL; if (trx == trx->bts->c0) load_timer_stop(trx->bts); + } else { + /* If we have no rsl_link yet it may mean that lower + * layers are still establishing the socket (TCP, IPA). + * Let's tell it to stop connection establishment since + * we are shutting down. */ + struct e1inp_line *line = e1inp_line_find(0); + if (line) + e1inp_ipa_bts_rsl_close_n(line, trx->nr); } /* Note: Here we could send NM_EV_RSL_DOWN to each * trx->(bb_transc.)mo.fi, but we are starting shutdown of the -- cgit v1.2.3