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>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/40231?usp=email )
Change subject: gen_makefile: fix building open5gs
......................................................................
gen_makefile: fix building open5gs
Fix that gen_src_proj_copy() returns a relative path for projects where
src_copy is not needed (either because the option is disabled or because
the project doesn't use autotools, such as open5gs). This leads to
generating the wrong build_to_src dir below, where os.path.relpath is
getting called on the generated src_proj_copy:
build_to_src = os.path.relpath(src_proj_copy, build_proj)
Fix for:
$ ./testenv.py run hss --podman
…
===== .make.open5gs.configure
chmod -R ug+w open5gs
rm -rf open5gs
mkdir -p open5gs
cd open5gs; CFLAGS=-g meson setup ../../../../../../../code/osmo-dev/src/open5gs . \
--prefix /home/user/.cache/osmo-ttcn3-testenv/podman/usr
ERROR: Neither directory contains a build file meson.build.
make: *** [Makefile:4501: .make.open5gs.configure] Error 1
Fixes: 9cf2b98e ("gen_makefile: add --autoreconf-in-src-copy arg")
Change-Id: I6da15a0d825d06a20fe435e3545fa92a27c80cb9
---
M gen_makefile.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, approved; Verified
laforge: Looks good to me, but someone else must approve
diff --git a/gen_makefile.py b/gen_makefile.py
index 548137d..c6e4a0b 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -437,7 +437,7 @@
def gen_src_proj_copy(src_proj, make_dir, proj):
if not is_src_copy_needed(proj):
- return src_proj
+ return os.path.join(make_dir, src_proj)
return os.path.join(make_dir, "src_copy", proj)
def gen_make(proj, deps, configure_opts, jobs, make_dir, src_dir, build_dir, url, push_url, sudo_make_install, no_ldconfig, ldconfig_without_sudo, make_check):
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/40231?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I6da15a0d825d06a20fe435e3545fa92a27c80cb9
Gerrit-Change-Number: 40231
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(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>