Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10333 )

Change subject: GSCON: avoid sending connection oriented data when not connected
......................................................................

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
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 19d4817..b97d51b 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -348,7 +348,12 @@

        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;


--
To view, visit https://gerrit.osmocom.org/10333
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4eaa983702224e5995a388ea9890ee04212eb569
Gerrit-Change-Number: 10333
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder

Reply via email to