summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-07 19:21:35 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-07 19:21:35 +0200
commitd717c7b27e1cd0b89c9557841c81f283494c1c08 (patch)
tree93e4b3b14d8b16e5d2dc3830a7148cb761b006c7
parente153044015b46b77e8a5f1647979969f53a8f9d6 (diff)
osmo_ss7: Fix segfault when routing MTP-TRANSFER.req to ASP without sctp connection
-rw-r--r--src/osmo_ss7.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 8ec099a..f7f2519 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1376,10 +1376,21 @@ int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg)
OSMO_ASSERT(0);
}
- if (asp->cfg.is_server)
+ if (asp->cfg.is_server) {
+ if (!asp->server) {
+ LOGPASP(asp, DLSS7, LOGL_ERROR, "Cannot transmit, no asp->server\n");
+ /* FIXME: what to do here? delete the route? send DUNA? */
+ return -EIO;
+ }
osmo_stream_srv_send(asp->server, msg);
- else
+ } else {
+ if (!asp->client) {
+ LOGPASP(asp, DLSS7, LOGL_ERROR, "Cannot transmit, no asp->client\n");
+ /* FIXME: what to do here? delete the route? send DUNA? */
+ return -EIO;
+ }
osmo_stream_cli_send(asp->client, msg);
+ }
return 0;
}