aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-03-18 21:56:04 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-18 23:00:27 +0100
commit8a991edd3658555974f32f0a44759878aef67df9 (patch)
tree34ab655592799a7cc70a9c5199d6f1e0f91e1b06
parent4de011561ff9cb97a4abc9990173c6af21f0a958 (diff)
a_iface: If L3/DTAP returns error in COMPL L3, close SCCP connection
It's pretty amazing that we print error messages anrd return error codes, but nobody ever looks at the error code and/or closes the connection. Let's change that. Change-Id: Iec693d8012a7816d1ded8206c2d979ac0546fb6e
-rw-r--r--src/libmsc/a_iface.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c
index fa8c5c33a..2b1baf0fb 100644
--- a/src/libmsc/a_iface.c
+++ b/src/libmsc/a_iface.c
@@ -535,9 +535,19 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu)
LOGP(DBSSAP, LOGL_DEBUG, "N-CONNECT.ind(%u, %s)\n",
scu_prim->u.connect.conn_id, msgb_hexdump_l2(oph->msg));
rc = a_sccp_rx_dt(scu, &a_conn_info, oph->msg);
- } else
+ } else {
LOGP(DBSSAP, LOGL_DEBUG, "N-CONNECT.ind(%u)\n", scu_prim->u.connect.conn_id);
- record_bsc_con(scu, a_conn_info.bsc, scu_prim->u.connect.conn_id);
+ rc = -ENODATA;
+ }
+
+ if (rc < 0) {
+ /* initial message (COMPL L3) caused some error, we didn't allocate
+ * a subscriber_conn and must close the connection again */
+ rc = osmo_sccp_tx_disconn(scu, a_conn_info.conn_id,
+ &a_conn_info.bsc->msc_addr,
+ SCCP_RETURN_CAUSE_UNQUALIFIED);
+ } else
+ record_bsc_con(scu, a_conn_info.bsc, scu_prim->u.connect.conn_id);
}
break;