fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/39631?usp=email )
Change subject: sctp_server: invalidate handler's Pid on 'EXIT'
......................................................................
sctp_server: invalidate handler's Pid on 'EXIT'
An 'EXIT' signal indicates that a connection handling process is dead,
so the respective pid shall not be referenced anymore. When this
happens, the current implementation sends an EOF to the eNB and simply
erases the respective client state from the clients dictionary.
The problem with this approach is that we're bypassing the logic
in client_del/2 and, as a result, never decrementing the
?S1GW_GAUGE_S1AP_ENB_NUM_SCTP_CONNECTIONS. When in sctp_recv/2 we
receive a 'shutdown_comp' event and call client_del/2, the client
state is already gone.
Instead of erasing the client state on 'EXIT', invalidate handler's
pid by setting it to undefined and keep the clients dictionary intact.
Leave the task of dictionary manipulation up to client_{add,del} API.
Change-Id: I21fedf8579baa54dc1e7ade348abffd7ee9b04c4
---
M src/sctp_server.erl
1 file changed, 9 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/31/39631/1
diff --git a/src/sctp_server.erl b/src/sctp_server.erl
index 9b10bbe..0a42011 100644
--- a/src/sctp_server.erl
+++ b/src/sctp_server.erl
@@ -69,7 +69,7 @@
}).
-record(client_state, {addr_port :: addr_port(),
- pid :: pid()
+ pid :: pid() | undefined
}).
@@ -153,10 +153,12 @@
#server_state{sock = Sock, clients = Clients} = S0) ->
?LOG_DEBUG("Child process ~p terminated with reason ~p", [Pid, Reason]),
case client_find(Pid, S0) of
- {ok, {Aid, _Client}} ->
+ {ok, {Aid, C0}} ->
%% gracefully close the eNB connection
gen_sctp:eof(Sock, #sctp_assoc_change{assoc_id = Aid}),
- S1 = S0#server_state{clients = dict:erase(Aid, Clients)},
+ %% invalidate pid in the client's state
+ C1 = C0#client_state{pid = undefined},
+ S1 = S0#server_state{clients = dict:store(Aid, C1, Clients)},
{noreply, S1};
error ->
{noreply, S0}
@@ -207,6 +209,9 @@
?LOG_DEBUG("eNB connection (id=~p, ~p:~p) -> MME: ~p", [Aid, FromAddr, FromPort, Data]),
s1gw_metrics:ctr_inc(?S1GW_CTR_S1AP_ENB_ALL_RX),
case dict:find(Aid, Clients) of
+ {ok, #client_state{pid = undefined}} ->
+ ?LOG_NOTICE("eNB connection (id=~p, ~p:~p) -> MME data ignored (no handler)",
+ [Aid, FromAddr, FromPort]);
{ok, #client_state{pid = Pid}} ->
Handler:send_data(Pid, Data);
error ->
@@ -247,6 +252,7 @@
s1gw_metrics:gauge_dec(?S1GW_GAUGE_S1AP_ENB_NUM_SCTP_CONNECTIONS),
S#server_state{clients = dict:erase(Aid, Clients)};
error ->
+ ?LOG_ERROR("eNB connection (id=~p) is not known to us?!?", [Aid]),
S
end.
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/39631?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I21fedf8579baa54dc1e7ade348abffd7ee9b04c4
Gerrit-Change-Number: 39631
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: pespin.
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/39626?usp=email )
Change subject: rtp2trau HR to DL: validate ToC octet of RFC 5993
......................................................................
Patch Set 1:
(1 comment)
File src/trau/trau_rtp_conv.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/39626/comment/f8d52039_565456dd… :
PS1, Line 671: if (data[0] & 0xD0)
> Having a bitmask of defines here would be a lot clearer.
The objective is to accept 0x00 or 0x20 and no others in the upper nibble, while accepting anything in the lower nibble. Masking with 0xD0 is the most efficient way to implement this check. In terms of the "bitmask of defines" you are asking for, can you please elaborate? Exactly how do you propose I change this code?
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/39626?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ibbaa1e1e12254eaf75a999dd1b58e2145eff158c
Gerrit-Change-Number: 39626
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 26 Feb 2025 19:16:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/39621?usp=email )
Change subject: tests: add unit tests for osmo_rtp2trau()
......................................................................
Patch Set 1:
(1 comment)
File tests/trau_conv/tw5reader.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/39621/comment/f5fc0d0c_b78a0c36… :
PS1, Line 37: int twts005_read_frame(FILE *hexf, unsigned *lineno, uint8_t *frame,
> In case you don't know about it, you may want to have a look at osmo_hexparse().
I am aware of that libosmocore function and have used it in other similar unit tests. However, in the present case because I am reading not just any hex format but specifically TW-TS-005 (besides just saying "it is hex", the spec defines maximum line length and NULL representation for 0-length RTP payloads), it was easier to copy/adapt the existing TW-TS-005 reader module/function from `gsm-codec-lib` than to reimplement a new one using `osmo_hexparse()`.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/39621?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ia5ca8af6bd3a899253bbcc718b70e43f2265b495
Gerrit-Change-Number: 39621
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 26 Feb 2025 18:58:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39630?usp=email )
Change subject: xua_rkm: Fix dynamic AS destroyed when multiple ASPs are associated
......................................................................
xua_rkm: Fix dynamic AS destroyed when multiple ASPs are associated
If more than 1 ASP was assigned to a dynamic ASP, when one of the ASP
would go down it would incorrectly tear down the associated dynamic AS.
This is wrong and should only happen when the last of the ASPs
associated to the AS is destroyed.
Change-Id: I986044944282cea9a13ed59424f2220fee6fe567
---
M src/osmo_ss7_as.c
M src/ss7_as.h
M src/xua_rkm.c
3 files changed, 20 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/30/39630/1
diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c
index eb655ca..076cc35 100644
--- a/src/osmo_ss7_as.c
+++ b/src/osmo_ss7_as.c
@@ -199,6 +199,21 @@
return false;
}
+/*! Determine amount of ASPs associated to an AS.
+ * \param[in] as Application Server.
+ * \returns number of ASPs associated to as */
+unsigned int osmo_ss7_as_count_asp(const struct osmo_ss7_as *as)
+{
+ unsigned int i;
+ unsigned int cnt = 0;
+
+ for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {
+ if (as->cfg.asps[i])
+ cnt++;
+ }
+ return cnt;
+}
+
/*! Determine if given AS is in the active state.
* \param[in] as Application Server.
* \returns true in case as is active; false otherwise. */
diff --git a/src/ss7_as.h b/src/ss7_as.h
index 504818c..9f4be25 100644
--- a/src/ss7_as.h
+++ b/src/ss7_as.h
@@ -67,5 +67,7 @@
} cfg;
};
+unsigned int osmo_ss7_as_count_asp(const struct osmo_ss7_as *as);
+
#define LOGPAS(as, subsys, level, fmt, args ...) \
_LOGSS7((as)->inst, subsys, level, "as-%s: " fmt, (as)->cfg.name, ## args)
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 9a3918e..dd07db2 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -601,10 +601,11 @@
llist_for_each_entry_safe(as, as2, &inst->as_list, list) {
if (!osmo_ss7_as_has_asp(as, asp))
continue;
- /* FIXME: check if there are no other ASPs! */
if (!as->rkm_dyn_allocated)
continue;
- osmo_ss7_as_destroy(as);
+ /* If there are no other ASPs, destroy the AS: */
+ if (osmo_ss7_as_count_asp(as) == 1)
+ osmo_ss7_as_destroy(as);
}
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39630?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I986044944282cea9a13ed59424f2220fee6fe567
Gerrit-Change-Number: 39630
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: osmith.
fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/39629?usp=email )
Change subject: jobs/dahdi: build against linux latest stable too
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/39629?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ib5031958d8b707bbdf32af9e582b7dabd9bd803c
Gerrit-Change-Number: 39629
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 26 Feb 2025 16:21:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: daniel, fixeria, pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39408?usp=email )
Change subject: ASP loadsharing: Implement based on VTY configuration
......................................................................
Patch Set 4: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39408?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: I5f47e40b70ed566034cd1533b71e21fc03e94f6c
Gerrit-Change-Number: 39408
Gerrit-PatchSet: 4
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-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 26 Feb 2025 14:04:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39398?usp=email )
Change subject: ASP loadsharing: Pass xua_msg down to xua_as_transmit_msg
......................................................................
Patch Set 5: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39398?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: I70e5d33c7537dc0b72b5abced876e69018cc0829
Gerrit-Change-Number: 39398
Gerrit-PatchSet: 5
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: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 26 Feb 2025 14:03:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397?usp=email )
Change subject: ASP loadsharing: Pass ownership of Rx xua_msg up the stack [2/2]
......................................................................
Patch Set 5: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397?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: Icf3b4dda550637f722a9fe56d0313f49c8a2964e
Gerrit-Change-Number: 39397
Gerrit-PatchSet: 5
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: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 26 Feb 2025 13:27:45 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes