diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2024-02-12 16:26:41 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2024-02-19 15:43:13 +0100 |
commit | 6d78c5308adf7f78cf5de2280b5b8c37fc886c00 (patch) | |
tree | 79bfa3508790df37d67bbd9cc6fb021cf9f217b9 | |
parent | 17586d41fa8e7bcbbc92d6f7af2823c259cb1daf (diff) |
wip reconnect notifyjolly/work
-rw-r--r-- | src/osmo_ss7_asp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index 539258c..458e7c1 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -835,11 +835,10 @@ static int xua_cli_connect_cb(struct osmo_stream_cli *cli) return rc; } -static void xua_cli_close(struct osmo_stream_cli *cli) +static void xua_cli_sctp_down(struct osmo_stream_cli *cli) { struct osmo_ss7_asp *asp = osmo_stream_cli_get_data(cli); - osmo_stream_cli_close(cli); osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_SCTP_COMM_DOWN_IND, asp); /* send M-SCTP_RELEASE.ind to XUA Layer Manager */ xua_asp_send_xlm_prim_simple(asp, OSMO_XLM_PRIM_M_SCTP_RELEASE, PRIM_OP_INDICATION); @@ -847,7 +846,8 @@ static void xua_cli_close(struct osmo_stream_cli *cli) static void xua_cli_close_and_reconnect(struct osmo_stream_cli *cli) { - xua_cli_close(cli); + osmo_stream_cli_close(cli); + xua_cli_sctp_down(cli); osmo_stream_cli_reconnect(cli); } @@ -892,6 +892,13 @@ static int xua_cli_read_cb(struct osmo_stream_cli *conn, struct msgb *msg) goto out; } + /* If connection has been closed, the client will try to re-connect. + * Indicate towards state machine that the connection has been closed. */ + if (msg->len == 0) { + xua_cli_sctp_down(conn); + goto out; + } + ppid = msgb_sctp_ppid(msg); msg->dst = asp; rate_ctr_inc2(asp->ctrg, SS7_ASP_CTR_PKT_RX_TOTAL); |