diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-04-01 20:55:54 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-04-11 21:39:44 +0000 |
commit | 4068ab278b66af7010c3acc73a7bb87bf651fc46 (patch) | |
tree | 096c6e858639e74703f272762dcead6df7c8df4b /src/libmsc/a_iface_bssap.c | |
parent | e3d3dc6ea218a07161eeb80ae864a96bef2d8e61 (diff) |
properly receive BSSMAP Clear Complete and Iu Release Complete
When sending a BSSMAP Clear or Iu Release, do not immediately discard the conn,
but wait until a BSSMAP Clear Complete / Iu Release Complete has been received.
Hence we will no longer show in the log that an incoming Release/Clear Complete
belongs to an unknown subscriber, but will still be around to properly log the
release.
Related: OS#3122
Change-Id: Ie4c6aaba3866d6e5b98004e8870a215e8cf8ffc1
Diffstat (limited to 'src/libmsc/a_iface_bssap.c')
-rw-r--r-- | src/libmsc/a_iface_bssap.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index d0d6bc03e..87ccf0532 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -239,11 +239,16 @@ static int bssmap_rx_clear_rqst(struct gsm_subscriber_connection *conn, /* Endpoint to handle BSSMAP clear complete */ static int bssmap_rx_clear_complete(struct osmo_sccp_user *scu, - const struct a_conn_info *a_conn_info, struct msgb *msg) + const struct a_conn_info *a_conn_info, + struct gsm_subscriber_connection *conn) { int rc; - LOGP(DMSC, LOGL_INFO, "Rx BSSMAP CLEAR COMPLETE, releasing SCCP connection\n"); + LOGPCONN(conn, LOGL_INFO, "Rx BSSMAP CLEAR COMPLETE, releasing SCCP connection\n"); + + if (conn) + msc_subscr_conn_rx_bssmap_clear_complete(conn); + rc = osmo_sccp_tx_disconn(scu, a_conn_info->conn_id, NULL, SCCP_RELEASE_CAUSE_END_USER_ORIGINATED); @@ -568,8 +573,6 @@ static int rx_bssmap(struct osmo_sccp_user *scu, const struct a_conn_info *a_con switch (msg_type) { case BSS_MAP_MSG_COMPLETE_LAYER_3: return bssmap_rx_l3_compl(scu, a_conn_info, msg, &tp); - case BSS_MAP_MSG_CLEAR_COMPLETE: - return bssmap_rx_clear_complete(scu, a_conn_info, msg); default: break; } @@ -577,6 +580,13 @@ static int rx_bssmap(struct osmo_sccp_user *scu, const struct a_conn_info *a_con conn = subscr_conn_lookup_a(a_conn_info->network, a_conn_info->conn_id); if (!conn) { LOGP(DBSSAP, LOGL_ERROR, "Couldn't find subscr_conn for conn_id=%d\n", a_conn_info->conn_id); + /* We expect a Clear Complete to come in on a valid conn. But if for some reason we still + * have the SCCP connection while the subscriber connection data is already gone, at + * least close the SCCP conn. */ + + if (msg_type == BSS_MAP_MSG_CLEAR_COMPLETE) + return bssmap_rx_clear_complete(scu, a_conn_info, NULL); + return -EINVAL; } @@ -585,6 +595,8 @@ static int rx_bssmap(struct osmo_sccp_user *scu, const struct a_conn_info *a_con switch (msg_type) { case BSS_MAP_MSG_CLEAR_RQST: return bssmap_rx_clear_rqst(conn, msg, &tp); + case BSS_MAP_MSG_CLEAR_COMPLETE: + return bssmap_rx_clear_complete(scu, a_conn_info, conn); case BSS_MAP_MSG_CLASSMARK_UPDATE: return bssmap_rx_classmark_upd(conn, msg, &tp); case BSS_MAP_MSG_CIPHER_MODE_COMPLETE: |