fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42356?usp=email )
Change subject: enb_proxy: fix stale SCTP events misprocessed during MME pool selection
......................................................................
enb_proxy: fix stale SCTP events misprocessed during MME pool selection
When closing a connection to one MME and opening a new one to the next,
a SHUTDOWN_COMP event from the old (now-closed) socket can still be
pending in the process mailbox. The sctp_assoc_change handlers in the
'connecting' and 'wait_s1setup_rsp' states were matching '_Socket',
ignoring the socket identity. A stale SHUTDOWN_COMP would therefore
fall into the '_ -> repeat_state_and_data' branch, triggering a spurious
re-entry of 'connecting', which immediately closed the newly established
connection to the next MME and skipped to yet another pool entry.
Fix this by matching the Socket against the current S#state.sock in both
handlers. Events arriving on a previously closed socket no longer match
these clauses and are silently dropped by the catch-all handle_event/4.
This was found thanks to the MME pooling TCs in ttcn3-s1gw-test.
Change-Id: I4211dd343607f045cf4dd33fa568ed580c79dd9f
Related: SYS#7052
---
M src/enb_proxy.erl
1 file changed, 8 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl
index 5ab79d1..3ce205f 100644
--- a/src/enb_proxy.erl
+++ b/src/enb_proxy.erl
@@ -235,9 +235,11 @@
keep_state_and_data;
%% Handle an #sctp_assoc_change event (connection state)
-connecting(info, {sctp, _Socket, MmeAddr, MmePort,
+%% Match on Socket to avoid processing stale events from a previously closed socket
+connecting(info, {sctp, Socket, MmeAddr, MmePort,
{[], #sctp_assoc_change{state = ConnState,
- assoc_id = Aid}}}, S) ->
+ assoc_id = Aid}}},
+ #state{sock = Socket} = S) ->
MmeName = hd(S#state.tried_mmes),
case ConnState of
comm_up ->
@@ -315,9 +317,11 @@
%% Handle an #sctp_assoc_change event (MME connection state)
%% We may loose connection while waiting for the S1 SETUP RESPONSE
-wait_s1setup_rsp(info, {sctp, _Socket, MmeAddr, MmePort,
+%% Match on Socket to avoid processing stale events from a previously closed socket
+wait_s1setup_rsp(info, {sctp, Socket, MmeAddr, MmePort,
{[], #sctp_assoc_change{state = ConnState,
- assoc_id = Aid}}}, S) ->
+ assoc_id = Aid}}},
+ #state{sock = Socket} = S) ->
case ConnState of
comm_up ->
?LOG_NOTICE("MME connection (id=~p, ~p:~p) is already established?!?",
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42356?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I4211dd343607f045cf4dd33fa568ed580c79dd9f
Gerrit-Change-Number: 42356
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria.
osmith has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42356?usp=email )
Change subject: enb_proxy: fix stale SCTP events misprocessed during MME pool selection
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42356?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I4211dd343607f045cf4dd33fa568ed580c79dd9f
Gerrit-Change-Number: 42356
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 17 Mar 2026 10:05:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: Timur Davydov.
pespin has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-trx/+/42411?usp=email )
Change subject: device/websdr: add WebSDR transceiver backend and build target
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
What I'm still missing here in order to properly review, is an explanation on why do you need a new radioInterface class and a new Transceiver class. What are the different requirements and differences in implementation with the existing ones? Why cannot we reuse the existing ones?
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/42411?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Ia0d340c323c2eea28fbe82601ba0af7cfbd68f6d
Gerrit-Change-Number: 42411
Gerrit-PatchSet: 4
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Comment-Date: Tue, 17 Mar 2026 10:03:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: pespin.
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42352?usp=email )
Change subject: mme_registry: add backwards compat for old sctp_client config
......................................................................
Patch Set 1:
(1 comment)
File src/osmo_s1gw_sup.erl:
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42352/comment/b3e9c997_c4a1… :
PS1, Line 75: osmo_s1gw:set_env(sctp_client, ClientCfg),
> It does not make a big difference. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42352?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: Ia97fb61bbb5ace6f43d1a6768fb5fb6883158532
Gerrit-Change-Number: 42352
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 17 Mar 2026 09:34:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: Timur Davydov, fixeria.
pespin has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-trx/+/42357?usp=email )
Change subject: proto_trxd: add helpers to prepare burst indication packets
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Can you re-arrange the commit order to put this commit before the one actually using the public function?
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/42357?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Ie94a1df4879cbf6056cd05c9621c46db1ed972fd
Gerrit-Change-Number: 42357
Gerrit-PatchSet: 2
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Comment-Date: Tue, 17 Mar 2026 08:07:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Timur Davydov.
pespin has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-trx/+/42421?usp=email )
Change subject: transceiver: return -EINVAL for invalid SETSLOT and preserve original behavior
......................................................................
Patch Set 1:
(1 comment)
File Transceiver52M/Transceiver.cpp:
https://gerrit.osmocom.org/c/osmo-trx/+/42421/comment/4f48d959_ecae261c?usp… :
PS1, Line 1090: return rc == -EINVAL ? 0 : rc; /* Ignore invalid values, but report other errors */
why ignore it here? I'd actually propagate the error since it means there was an error, there's no negative timeslot nor >7.
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/42421?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I90bda68268abdeee9c766a3bf4189fba8f13da53
Gerrit-Change-Number: 42421
Gerrit-PatchSet: 1
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Comment-Date: Tue, 17 Mar 2026 08:06:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No