pespin has uploaded this change for review.

View Change

Use osmo_ss7_asp_active() in several places

Change-Id: I172e691cb61ac68e2410b44e124737f7a4dd2775
---
M src/m3ua.c
M src/sua.c
M src/xua_as_fsm.c
M src/xua_rkm.c
4 files changed, 4 insertions(+), 4 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/70/42570/1
diff --git a/src/m3ua.c b/src/m3ua.c
index a22a64a..243f5b9 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -1166,7 +1166,7 @@
int rc;

/* SNM only permitted in ACTIVE state */
- if (asp->fi->state != XUA_ASP_S_ACTIVE) {
+ if (!osmo_ss7_asp_active(asp)) {
if (asp->fi->state == XUA_ASP_S_INACTIVE &&
asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_SNM_INACTIVE) {
LOGPASP(asp, DLM3UA, LOGL_NOTICE, "quirk snm_inactive active: "
diff --git a/src/sua.c b/src/sua.c
index 9ebe4c6..b169d50 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -1113,7 +1113,7 @@
static int sua_rx_snm(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
/* SNM only permitted in ACTIVE state */
- if (asp->fi->state != XUA_ASP_S_ACTIVE) {
+ if (!osmo_ss7_asp_active(asp)) {
if (asp->fi->state == XUA_ASP_S_INACTIVE && asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_SNM_INACTIVE) {
LOGPASP(asp, DLSUA, LOGL_NOTICE, "quirk snm_inactive active: "
"Accepting SSNM in state %s\n", osmo_fsm_inst_state_name(asp->fi));
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index 568834e..0ba1b2a 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -296,7 +296,7 @@
if (asp_cmp == asp)
continue;

- if (asp->fi && asp->fi->state == XUA_ASP_S_ACTIVE)
+ if (osmo_ss7_asp_active(asp))
return true;
}

diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 16b494b..92fbdac 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -420,7 +420,7 @@
}

/* Reject if ASP is still active */
- if (asp->fi->state == XUA_ASP_S_ACTIVE) {
+ if (osmo_ss7_asp_active(asp)) {
msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_ASP_ACTIVE, 0);
return -1;
}

To view, visit change 42570. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I172e691cb61ac68e2410b44e124737f7a4dd2775
Gerrit-Change-Number: 42570
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>