diff options
author | Max <msuraev@sysmocom.de> | 2023-02-11 15:32:50 +0300 |
---|---|---|
committer | msuraev <msuraev@sysmocom.de> | 2023-02-21 08:51:22 +0000 |
commit | 6e8241356b832d6d45a4d5051fb1397701e59071 (patch) | |
tree | 4e2889baac985e988e436a132492dceec07964a1 /src/osmo_ss7_hmrt.c | |
parent | e753f21047dcb4941cd4418f263c72799c69e14b (diff) |
SS7: do not attempt transfer if AS is down
The attempt to route message via AS which is down will fail anyway:
let's make it explicit.
Add osmo_ss7_as_down() and use it to check AS state before transferring the message.
Change-Id: I0d5f3b6265e7fdaa79e32fbc30f829ef79e7dad1
Diffstat (limited to 'src/osmo_ss7_hmrt.c')
-rw-r--r-- | src/osmo_ss7_hmrt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c index f5fcd64..3ac43b8 100644 --- a/src/osmo_ss7_hmrt.c +++ b/src/osmo_ss7_hmrt.c @@ -228,6 +228,12 @@ static int hmrt_message_for_routing(struct osmo_ss7_instance *inst, dpc, osmo_ss7_pointcode_print(inst, dpc), rt_name); } + if (osmo_ss7_as_down(as)) { + LOGP(DLSS7, LOGL_ERROR, "Unable to route HMRT message: the AS %s is down\n", + as->cfg.name); + return -ENETDOWN; + } + rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TX_MSU_TOTAL); switch (as->cfg.proto) { |