aboutsummaryrefslogtreecommitdiffstats
path: root/src/mtp_layer3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mtp_layer3.c')
-rw-r--r--src/mtp_layer3.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c
index 45bbfa3..928a05c 100644
--- a/src/mtp_layer3.c
+++ b/src/mtp_layer3.c
@@ -23,6 +23,7 @@
#include <bsc_data.h>
#include <cellmgr_debug.h>
#include <isup_types.h>
+#include <ss7_application.h>
#include <counter.h>
#include <osmocore/talloc.h>
@@ -37,6 +38,15 @@ static int mtp_int_submit(struct mtp_link_set *set, int pc, int sls, int type, c
void mtp_link_submit(struct mtp_link *link, struct msgb *msg)
{
+ if (link->set->app && link->set->app->type == APP_STP) {
+ if (!link->set->app->route_src.up || !link->set->app->route_dst.up) {
+ LOGP(DINP, LOGL_NOTICE, "Not sending data as application is down %d/%s.\n",
+ link->set->app->nr, link->set->app->name);
+ msgb_free(msg);
+ return;
+ }
+ }
+
rate_ctr_inc(&link->ctrg->ctr[MTP_LNK_OUT]);
rate_ctr_inc(&link->set->ctrg->ctr[MTP_LSET_TOTA_OUT_MSG]);
link->write(link, msg);