aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-03-03 01:16:53 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-03-03 01:20:03 +0100
commit56cba9ab45b3788b92d1e18259e7629b6f6350d9 (patch)
treed0bd14c60ade867e0635857f8fa4e5251c3ff6ff
parent899198ed2ea73fbc554c28bd3da567e2363b18e3 (diff)
ss7: Drop the input of packages as wellzecke/test-forward-failure
We don't want the input change any state on the linkset and will drop them if we think our application is not reachable.
-rw-r--r--include/mtp_data.h1
-rw-r--r--src/mtp_layer3.c2
-rw-r--r--src/ss7_application.c13
3 files changed, 15 insertions, 1 deletions
diff --git a/include/mtp_data.h b/include/mtp_data.h
index 4af3777..a8f9463 100644
--- a/include/mtp_data.h
+++ b/include/mtp_data.h
@@ -144,6 +144,7 @@ struct mtp_link {
void mtp_link_set_stop(struct mtp_link_set *set);
void mtp_link_set_reset(struct mtp_link_set *set);
int mtp_link_set_data(struct mtp_link *link, struct msgb *msg);
+int mtp_link_handle_data(struct mtp_link *link, struct msgb *msg);
int mtp_link_set_submit_sccp_data(struct mtp_link_set *set, int sls, const uint8_t *data, unsigned int length);
int mtp_link_set_submit_isup_data(struct mtp_link_set *set, int sls, const uint8_t *data, unsigned int length);
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c
index 95e5dfc..dc24a73 100644
--- a/src/mtp_layer3.c
+++ b/src/mtp_layer3.c
@@ -465,7 +465,7 @@ static int mtp_link_sccp_data(struct mtp_link_set *set, struct mtp_level_3_hdr *
return 0;
}
-int mtp_link_set_data(struct mtp_link *link, struct msgb *msg)
+int mtp_link_handle_data(struct mtp_link *link, struct msgb *msg)
{
int rc = -1;
struct mtp_level_3_hdr *hdr;
diff --git a/src/ss7_application.c b/src/ss7_application.c
index 0609603..831ae1e 100644
--- a/src/ss7_application.c
+++ b/src/ss7_application.c
@@ -398,3 +398,16 @@ void mtp_link_submit(struct mtp_link *link, struct msgb *msg)
rate_ctr_inc(&link->set->ctrg->ctr[MTP_LSET_TOTA_OUT_MSG]);
link->write(link, msg);
}
+
+int mtp_link_set_data(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 handling data as application is down %d/%s.\n",
+ link->set->app->nr, link->set->app->name);
+ return -1;
+ }
+ }
+
+ return mtp_link_handle_data(link, msg);
+}