pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40190?usp=email )
Change subject: xua_asp_fsm: Reuse ss7_asp_get_all_rctx_be() in xua_msg_add_asp_rctx()
......................................................................
xua_asp_fsm: Reuse ss7_asp_get_all_rctx_be() in xua_msg_add_asp_rctx()
Change-Id: I6fe4f388b11991e7c7396c9d632b376e8591a8f3
---
M src/xua_asp_fsm.c
1 file changed, 5 insertions(+), 23 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 4603734..11a34b4 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -173,32 +173,14 @@
/* add M3UA_IEI_ROUTE_CTX to xua_msg containig all routing keys of ASs within ASP */
static int xua_msg_add_asp_rctx(struct xua_msg *xua, struct osmo_ss7_asp *asp)
{
- struct osmo_ss7_as *as;
uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT];
- unsigned int i = 0;
+ unsigned int cnt;
- /* iterate over all ASs and build array of routing contexts */
- llist_for_each_entry(as, &asp->inst->as_list, list) {
- if (!osmo_ss7_as_has_asp(as, asp))
- continue;
- rctx[i++] = htonl(as->cfg.routing_key.context);
- if (i >= ARRAY_SIZE(rctx)-1) {
- break;
- }
- }
- /* add xUA IE with routing contests to the message (if any) */
- if (i) {
- /* bail out (and not add the IE) if there's only one routing context (and hence
- * only one AS) within this ASP, and that routing context is zero, meaning no routing
- * context IE shall be used */
- if (i == 1 && rctx[0] == 0)
- return 0;
-
- xua_msg_add_data(xua, M3UA_IEI_ROUTE_CTX, i*sizeof(uint32_t), (uint8_t *)rctx);
- }
-
+ cnt = ss7_asp_get_all_rctx_be(asp, rctx, ARRAY_SIZE(rctx), NULL);
+ if (cnt > 0)
+ xua_msg_add_data(xua, M3UA_IEI_ROUTE_CTX, cnt*sizeof(uint32_t), (uint8_t *)rctx);
/* return count of routing contexts added */
- return i;
+ return cnt;
}
/* ask the xUA implementation to transmit a specific message */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40190?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I6fe4f388b11991e7c7396c9d632b376e8591a8f3
Gerrit-Change-Number: 40190
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40193?usp=email )
Change subject: asp: Make sure asp->{client,server} is nulled before destroy callback
......................................................................
asp: Make sure asp->{client,server} is nulled before destroy callback
disconnect_cb() in case of stream_cli and closed_cb() in case of
stream_srv may call some libosmo-sigtran code. Make sure we don't access
the pointer anymore in that case for safety.
Change-Id: I3f0774eac630c8bc7e9a10f874e1c72763fd14a0
---
M src/osmo_ss7_asp.c
1 file changed, 7 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index c054369..4044003 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -686,22 +686,27 @@
* announce disconnection to upper layers. */
int ss7_asp_disconnect_stream(struct osmo_ss7_asp *asp)
{
+ struct osmo_stream_cli *cli;
+ struct osmo_stream_srv *srv;
+
/* First tear down previous state if existing: */
if (asp->cfg.is_server) {
/* We are in server mode now */
if (asp->client) {
/* if we previously were in client mode,
* destroy it */
- osmo_stream_cli_destroy(asp->client);
+ cli = asp->client;
asp->client = NULL;
+ osmo_stream_cli_destroy(cli);
}
} else {
/* We are in client mode now */
if (asp->server) {
/* if we previously were in server mode,
* destroy it */
- osmo_stream_srv_destroy(asp->server);
+ srv = asp->server;
asp->server = NULL;
+ osmo_stream_srv_destroy(srv);
}
if (asp->client) {
/* Make sure we close the previous stream before starting a new one: */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40193?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I3f0774eac630c8bc7e9a10f874e1c72763fd14a0
Gerrit-Change-Number: 40193
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40194?usp=email )
Change subject: asp: Make sure previous stream_srv is immediatelly destroyed when requested
......................................................................
asp: Make sure previous stream_srv is immediatelly destroyed when requested
This will be needed when the asp is in SCTP=server mode and we request
it to shutdown/restart.
Path in xua_accept_cb() for dynamic ASPs in SCTP=server mode needs to be
fixed since it was wrongly calling osmo_ss7_asp_restart() and taking
advantage of the fact that the asp->server was not being freed in that
case.
Change-Id: I8edd64234654ba987f35de2d7ad610e96bda27eb
---
M src/osmo_ss7_asp.c
M src/osmo_ss7_xua_srv.c
2 files changed, 12 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index 4044003..02dbcb8 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -699,6 +699,12 @@
asp->client = NULL;
osmo_stream_cli_destroy(cli);
}
+ if (asp->server) {
+ /* Make sure we close the previous stream right now: */
+ srv = asp->server;
+ asp->server = NULL;
+ osmo_stream_srv_destroy(srv);
+ }
} else {
/* We are in client mode now */
if (asp->server) {
diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c
index 52a3508..5483aae 100644
--- a/src/osmo_ss7_xua_srv.c
+++ b/src/osmo_ss7_xua_srv.c
@@ -153,7 +153,12 @@
oxs->cfg.local.host_cnt);
ss7_asp_peer_set_hosts(&asp->cfg.remote, asp,
&hostbuf_ptr, 1);
- osmo_ss7_asp_restart(asp);
+ if ((rc = xua_asp_fsm_start(asp, asp->cfg.role, LOGL_DEBUG)) < 0) {
+ talloc_free(sock_name);
+ osmo_ss7_asp_destroy(asp);
+ return rc;
+ }
+ OSMO_ASSERT(asp->fi);
}
}
if (!asp) {
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40194?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I8edd64234654ba987f35de2d7ad610e96bda27eb
Gerrit-Change-Number: 40194
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40197?usp=email )
Change subject: Implement ASP adm state shutdown
......................................................................
Patch Set 1:
(1 comment)
File src/osmo_ss7_vty.c:
https://gerrit.osmocom.org/c/libosmo-sigtran/+/40197/comment/3b8f15ef_315e2… :
PS1, Line 1444: "Terminates SCTP association; New associations will be rejected\n"
> does it rally make sense to have this help text for no-shutdown?
well it has the "NO_STR" in front, I think we usually make it this way.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40197?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I7e4eedb65c4f2952f8b39ca4c539ca2f40e9946c
Gerrit-Change-Number: 40197
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 06 May 2025 14:58:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>