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
This commit is contained in:
Harald Welte 2018-03-18 21:56:04 +01:00
parent 4de011561f
commit 8a991edd36
1 changed files with 12 additions and 2 deletions

View File

@ -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;