Change in libosmo-sccp[master]: xua: loadshare: select ASP for tx only if active

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Nov 5 18:13:11 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/15980 )


Change subject: xua: loadshare: select ASP for tx only if active
......................................................................

xua: loadshare: select ASP for tx only if active

Change-Id: I4f1d1aa9395698e5b6b930a5092a4b914dd15fb3
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7.c
M src/xua_as_fsm.c
3 files changed, 9 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/80/15980/1

diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 4f20d81..26b871b 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -431,6 +431,7 @@
 int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg);
 int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp);
 int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level);
+bool osmo_ss7_asp_active(const struct osmo_ss7_asp *asp);
 
 /*! Weak function to handle payload for unknown/unsupported PPID or IPA StreamID.
  *  This function can be overridden by application code to implement whatever handling
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index efbceb8..532b332 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1350,6 +1350,13 @@
 	return 0;
 }
 
+bool osmo_ss7_asp_active(const struct osmo_ss7_asp *asp)
+{
+	if (!asp->fi)
+		return false;
+	return asp->fi->state == XUA_ASP_S_ACTIVE;
+}
+
 /***********************************************************************
  * libosmo-netif integration for SCTP stream server/client
  ***********************************************************************/
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index cf75ef3..b7074aa 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -97,7 +97,7 @@
 	i = first_idx;
 	do {
 		asp = as->cfg.asps[i];
-		if (asp)
+		if (asp && osmo_ss7_asp_active(asp))
 			break;
 		i = (i + 1) % ARRAY_SIZE(as->cfg.asps);
 	} while (i != first_idx);

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15980
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I4f1d1aa9395698e5b6b930a5092a4b914dd15fb3
Gerrit-Change-Number: 15980
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191105/b39740e3/attachment.htm>


More information about the gerrit-log mailing list