diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-08-06 16:34:32 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2018-08-07 12:09:01 +0200 |
commit | bf4e29a7dff6e3b5ce9e4da150b8b1dfce86be83 (patch) | |
tree | 551fed105b70e984ad813f4ecdb404544d8a012b /src | |
parent | c1a0f7a1f5db1177679c26554c19e72a943d9510 (diff) |
GSCON: avoid sending connection oriented data when not connected
When no connection is present and had never existed, then
conn->sccp.msc is unpopulated. However, there may be situations where
osmo_bsc_sigtran_send() is executed while no connection is present.
At the moment we assert on conn->sccp.msc, which would cause osmo-bsc
to exit. In order to avoid this, better check conn->sccp.msc and drop
the sccp message when the check is negative.
- Remove assertion, add check.
Change-Id: I4eaa983702224e5995a388ea9890ee04212eb569
Related: OS#3446
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_sigtran.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 19d481787..b97d51bce 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -348,7 +348,12 @@ int osmo_bsc_sigtran_send(struct gsm_subscriber_connection *conn, struct msgb *m OSMO_ASSERT(conn); OSMO_ASSERT(msg); - OSMO_ASSERT(conn->sccp.msc); + + if (!conn->sccp.msc) { + LOGP(DMSC, LOGL_ERROR, "MSC is not connected. Dropping.\n"); + msgb_free(msg); + return -EINVAL; + } msc = conn->sccp.msc; |