lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

March 2026

  • 1 participants
  • 1933 discussions
[M] Change in libosmo-sigtran[master]: asp: Configure block and shutdown adm state independently
by pespin 30 Mar '26

30 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42528?usp=email ) Change subject: asp: Configure block and shutdown adm state independently ...................................................................... asp: Configure block and shutdown adm state independently The block/no block and shutdown/no shutdown commands tweak independent states; adapt the code to what's presented to the user. This simplifies handling of both states, since the user may want eg. have it blocked and shutdown, and then "no shutdown" it but make sure it stays blocked so no race condition happens. Related: OS#6752 Change-Id: I3ab81a4f6f6b72015c5068d5a27128642622cf99 --- M include/osmocom/sigtran/osmo_ss7.h M src/ss7_asp.c M src/ss7_asp.h M src/ss7_asp_vty.c M src/ss7_xua_srv.c 5 files changed, 22 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/28/42528/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 162994e..074027f 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -240,16 +240,6 @@ * SS7 Application Server Processes ***********************************************************************/ -enum osmo_ss7_asp_admin_state { - /*! no SCTP association with peer */ - OSMO_SS7_ASP_ADM_S_SHUTDOWN, - /*! SCP association, but reject ASP-ACTIVE */ - OSMO_SS7_ASP_ADM_S_BLOCKED, - /*! in normal operation */ - OSMO_SS7_ASP_ADM_S_ENABLED, -}; -extern const struct value_string osmo_ss7_asp_admin_state_names[]; - enum osmo_ss7_asp_role { OSMO_SS7_ASP_ROLE_ASP, OSMO_SS7_ASP_ROLE_SG, diff --git a/src/ss7_asp.c b/src/ss7_asp.c index 40433d0..f83de19 100644 --- a/src/ss7_asp.c +++ b/src/ss7_asp.c @@ -149,13 +149,6 @@ { 0, NULL } }; -const struct value_string osmo_ss7_asp_admin_state_names[] = { - { OSMO_SS7_ASP_ADM_S_SHUTDOWN, "SHUTDOWN" }, - { OSMO_SS7_ASP_ADM_S_BLOCKED, "BLOCKED" }, - { OSMO_SS7_ASP_ADM_S_ENABLED, "ENABLED" }, - { 0, NULL } -}; - const struct value_string osmo_ss7_asp_role_names[] = { { OSMO_SS7_ASP_ROLE_ASP, "ASP" }, { OSMO_SS7_ASP_ROLE_SG, "SG" }, @@ -744,7 +737,7 @@ asp->inst = inst; INIT_LLIST_HEAD(&asp->assoc_as_list); /* ASP in "no shutdown" state by default: */ - asp->cfg.adm_state = OSMO_SS7_ASP_ADM_S_ENABLED; + asp->cfg.adm_state.shutdown = false; ss7_asp_peer_init(&asp->cfg.remote); asp->cfg.remote.port = remote_port; ss7_asp_peer_init(&asp->cfg.local); @@ -938,9 +931,8 @@ return rc; OSMO_ASSERT(asp->fi); - if (asp->cfg.adm_state == OSMO_SS7_ASP_ADM_S_SHUTDOWN) { - LOGPASP(asp, DLSS7, LOGL_NOTICE, "Skipping start for ASP in administrative state %s\n", - get_value_string(osmo_ss7_asp_admin_state_names, OSMO_SS7_ASP_ADM_S_SHUTDOWN)); + if (asp->cfg.adm_state.shutdown) { + LOGPASP(asp, DLSS7, LOGL_NOTICE, "Skipping start for ASP in administrative state 'shutdown'\n"); return 0; } @@ -1256,7 +1248,7 @@ struct osmo_ss7_asp *asp = osmo_stream_cli_get_data(cli); LOGPASP(asp, DLSS7, LOGL_NOTICE, "Closing and reconnecting ASP\n"); xua_cli_close(cli); - if (asp->cfg.adm_state != OSMO_SS7_ASP_ADM_S_SHUTDOWN) + if (!asp->cfg.adm_state.shutdown) osmo_stream_cli_reconnect(cli); return 0; } diff --git a/src/ss7_asp.h b/src/ss7_asp.h index 7bce2d4..834f910 100644 --- a/src/ss7_asp.h +++ b/src/ss7_asp.h @@ -112,7 +112,12 @@ char *name; char *description; enum osmo_ss7_asp_protocol proto; - enum osmo_ss7_asp_admin_state adm_state; + struct { + /*! no SCTP association with peer */ + bool shutdown:1; + /*! SCP association, but reject ASP-ACTIVE */ + bool blocked:1; + } adm_state; bool is_server; enum osmo_ss7_asp_role role; bool role_set_by_vty; diff --git a/src/ss7_asp_vty.c b/src/ss7_asp_vty.c index f13cb60..3cae016 100644 --- a/src/ss7_asp_vty.c +++ b/src/ss7_asp_vty.c @@ -717,12 +717,11 @@ { struct osmo_ss7_asp *asp = vty->index; - LOGPASP(asp, DLSS7, LOGL_NOTICE, "Applying Adm State change: %s -> %s\n", - get_value_string(osmo_ss7_asp_admin_state_names, asp->cfg.adm_state), - get_value_string(osmo_ss7_asp_admin_state_names, OSMO_SS7_ASP_ADM_S_SHUTDOWN)); + LOGPASP(asp, DLSS7, LOGL_NOTICE, "Applying Adm State change: '%sshutdown' -> 'shutdown'\n", + asp->cfg.adm_state.shutdown ? "" : "no "); asp->cfg.explicit_shutdown_state_by_vty_since_node_enter = true; - asp->cfg.adm_state = OSMO_SS7_ASP_ADM_S_SHUTDOWN; + asp->cfg.adm_state.shutdown = true; ss7_asp_restart_after_reconfigure(asp); return CMD_SUCCESS; } @@ -734,12 +733,11 @@ { struct osmo_ss7_asp *asp = vty->index; - LOGPASP(asp, DLSS7, LOGL_NOTICE, "Applying Adm State change: %s -> %s\n", - get_value_string(osmo_ss7_asp_admin_state_names, asp->cfg.adm_state), - get_value_string(osmo_ss7_asp_admin_state_names, OSMO_SS7_ASP_ADM_S_ENABLED)); + LOGPASP(asp, DLSS7, LOGL_NOTICE, "Applying Adm State change: '%sshutdown' -> 'no shutdown'\n", + asp->cfg.adm_state.shutdown ? "" : "no "); asp->cfg.explicit_shutdown_state_by_vty_since_node_enter = true; - asp->cfg.adm_state = OSMO_SS7_ASP_ADM_S_ENABLED; + asp->cfg.adm_state.shutdown = false; ss7_asp_restart_after_reconfigure(asp); return CMD_SUCCESS; } @@ -1406,18 +1404,10 @@ write_asp_timers_xua(vty, " ", asp); write_asp_timers_lm(vty, " ", asp); - switch (asp->cfg.adm_state) { - case OSMO_SS7_ASP_ADM_S_SHUTDOWN: - vty_out(vty, " shutdown%s", VTY_NEWLINE); - break; - case OSMO_SS7_ASP_ADM_S_BLOCKED: + if (asp->cfg.adm_state.blocked) vty_out(vty, " block%s", VTY_NEWLINE); - break; - case OSMO_SS7_ASP_ADM_S_ENABLED: - /* Default, no need to print: */ - vty_out(vty, " no shutdown%s", VTY_NEWLINE); - break; - } + + vty_out(vty, " %sshutdown%s", asp->cfg.adm_state.shutdown ? "" : "no ", VTY_NEWLINE); } int ss7_vty_node_asp_go_parent(struct vty *vty) diff --git a/src/ss7_xua_srv.c b/src/ss7_xua_srv.c index deb1808..11e0d0b 100644 --- a/src/ss7_xua_srv.c +++ b/src/ss7_xua_srv.c @@ -85,10 +85,10 @@ talloc_free(sock_name); return 0; } - if (asp->cfg.adm_state == OSMO_SS7_ASP_ADM_S_SHUTDOWN) { + if (asp->cfg.adm_state.shutdown) { LOGPASP(asp, DLSS7, LOGL_NOTICE, - "Reject incoming new connection from %s for ASP in adm state %s\n", - sock_name, get_value_string(osmo_ss7_asp_admin_state_names, asp->cfg.adm_state)); + "Reject incoming new connection from %s for ASP in adm state 'shutdown'\n", + sock_name); close(fd); talloc_free(sock_name); return 0; -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42528?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: I3ab81a4f6f6b72015c5068d5a27128642622cf99 Gerrit-Change-Number: 42528 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: asp_vty: Fix wrong vty write 'blocked' command
by pespin 30 Mar '26

30 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42527?usp=email ) Change subject: asp_vty: Fix wrong vty write 'blocked' command ...................................................................... asp_vty: Fix wrong vty write 'blocked' command This is not criticial since "block"/"no block" commands are yet to be fully implemented. Change-Id: Ia42a064cfdbba025bc3ae5479e8e6edec4abe770 --- M src/ss7_asp_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/27/42527/1 diff --git a/src/ss7_asp_vty.c b/src/ss7_asp_vty.c index 6b03275..f13cb60 100644 --- a/src/ss7_asp_vty.c +++ b/src/ss7_asp_vty.c @@ -1411,7 +1411,7 @@ vty_out(vty, " shutdown%s", VTY_NEWLINE); break; case OSMO_SS7_ASP_ADM_S_BLOCKED: - vty_out(vty, " blocked%s", VTY_NEWLINE); + vty_out(vty, " block%s", VTY_NEWLINE); break; case OSMO_SS7_ASP_ADM_S_ENABLED: /* Default, no need to print: */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42527?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: Ia42a064cfdbba025bc3ae5479e8e6edec4abe770 Gerrit-Change-Number: 42527 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: xua_asp_fsm: XUA_ASP_E_ASPTM_ASPAC: Validate RCTX AS is associated to...
by pespin 30 Mar '26

30 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42530?usp=email ) Change subject: xua_asp_fsm: XUA_ASP_E_ASPTM_ASPAC: Validate RCTX AS is associated to ASP ...................................................................... xua_asp_fsm: XUA_ASP_E_ASPTM_ASPAC: Validate RCTX AS is associated to ASP Previously we only validated that a local AS was configured for the provided routing context, but we didn't validate that the AS was actually associated to the requesting ASP. Change-Id: Idcd51b9bbe38064ed03d076a76279384a3927334 --- M src/ss7_asp.c M src/ss7_asp.h M src/xua_asp_fsm.c M tests/ss7/ss7_test.c 4 files changed, 21 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/30/42530/1 diff --git a/src/ss7_asp.c b/src/ss7_asp.c index f83de19..ba3b95c 100644 --- a/src/ss7_asp.c +++ b/src/ss7_asp.c @@ -1578,6 +1578,21 @@ return _ss7_asp_get_all_rctx(asp, rctx, rctx_size, excl_as, false); } +/*! \brief Find Application Server associated to ASP by given routing context + * \param[in] asp Application Server Process through which to send + * \param[in] rctx Routing Context + * \returns pointer to Application Server on success; NULL otherwise */ +struct osmo_ss7_as *ss7_asp_find_as_by_rctx(const struct osmo_ss7_asp *asp, uint32_t rctx) +{ + struct ss7_as_asp_assoc *assoc; + + llist_for_each_entry(assoc, &asp->assoc_as_list, asp_entry) { + if (assoc->as->cfg.routing_key.context == rctx) + return assoc->as; + } + return NULL; +} + /* Get first AS in the ASP, or NULL if no AS associated. * This is useful for instance in IPA code, where we assume only up to 1 AS is configured per ASP. */ struct osmo_ss7_as *ss7_asp_get_first_as(const struct osmo_ss7_asp *asp) diff --git a/src/ss7_asp.h b/src/ss7_asp.h index 834f910..6b8e974 100644 --- a/src/ss7_asp.h +++ b/src/ss7_asp.h @@ -198,6 +198,7 @@ const struct osmo_ss7_as *excl_as); unsigned int ss7_asp_get_all_rctx_be(const struct osmo_ss7_asp *asp, uint32_t *rctx, unsigned int rctx_size, const struct osmo_ss7_as *excl_as); +struct osmo_ss7_as *ss7_asp_find_as_by_rctx(const struct osmo_ss7_asp *asp, uint32_t rctx); struct osmo_ss7_as *ss7_asp_get_first_as(const struct osmo_ss7_asp *asp); int ss7_asp_determine_traf_mode(const struct osmo_ss7_asp *asp); diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c index 5cb28fc..d627795 100644 --- a/src/xua_asp_fsm.c +++ b/src/xua_asp_fsm.c @@ -704,7 +704,7 @@ if ((part = xua_msg_find_tag(xua_in, M3UA_IEI_ROUTE_CTX))) { for (i = 0; i < part->len / sizeof(uint32_t); i++) { uint32_t rctx = osmo_load32be(&part->dat[i * sizeof(uint32_t)]); - as = osmo_ss7_as_find_by_rctx(asp->inst, rctx); + as = ss7_asp_find_as_by_rctx(asp, rctx); if (!as) { LOGPFSML(fi, LOGL_NOTICE, "ASPAC: Couldn't find any AS with rctx=%u. Check your config!\n", diff --git a/tests/ss7/ss7_test.c b/tests/ss7/ss7_test.c index 977f1f4..aec886f 100644 --- a/tests/ss7/ss7_test.c +++ b/tests/ss7/ss7_test.c @@ -289,7 +289,11 @@ OSMO_ASSERT(asp); OSMO_ASSERT(osmo_ss7_as_has_asp(as, asp) == false); + OSMO_ASSERT(ss7_asp_find_as_by_rctx(asp, as->cfg.routing_key.context) == NULL); + OSMO_ASSERT(osmo_ss7_as_add_asp(as, "asp1") == 0); + OSMO_ASSERT(osmo_ss7_as_has_asp(as, asp) == true); + OSMO_ASSERT(ss7_asp_find_as_by_rctx(asp, as->cfg.routing_key.context) == as); osmo_ss7_asp_restart(asp); -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42530?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: Idcd51b9bbe38064ed03d076a76279384a3927334 Gerrit-Change-Number: 42530 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: xua_rkm: handle_rkey_reg(): Skip AS ilookup of known free RCTX
by pespin 30 Mar '26

30 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42531?usp=email ) Change subject: xua_rkm: handle_rkey_reg(): Skip AS ilookup of known free RCTX ...................................................................... xua_rkm: handle_rkey_reg(): Skip AS ilookup of known free RCTX There's no need to attempt a look up for an AS with a RCTX we just ensured is not yet allocated to any AS. Change-Id: I40719527c527db58244972a797c4287107306532 --- M src/xua_rkm.c 1 file changed, 12 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/31/42531/1 diff --git a/src/xua_rkm.c b/src/xua_rkm.c index d6dfa51..e9972b3 100644 --- a/src/xua_rkm.c +++ b/src/xua_rkm.c @@ -171,7 +171,7 @@ { uint32_t rk_id, rctx, _tmode, dpc; enum osmo_ss7_as_traffic_mode tmode; - struct osmo_ss7_as *as; + struct osmo_ss7_as *as = NULL; struct ss7_as_asp_assoc *assoc; struct osmo_ss7_route *rt; char namebuf[32]; @@ -211,14 +211,6 @@ return -1; } - /* if the ASP did not include a routing context number, allocate - * one locally (will be part of response) */ - if (!rctx) - rctx = osmo_ss7_find_free_rctx(asp->inst); - - LOGPASP(asp, DLSS7, LOGL_INFO, "RKM: Registering routing key %u for DPC %s\n", - rctx, osmo_ss7_pointcode_print(asp->inst, dpc)); - /* We have two cases here: * a) pre-configured routing context on both ASP and SG (or IPSP peers): * We will find the AS based on the RCTX send by the client, check if @@ -231,8 +223,17 @@ * all AS/RK in situations where the peers are trusted. */ - /* check if there is already an AS for this routing key */ - as = osmo_ss7_as_find_by_rctx(asp->inst, rctx); + if (rctx) { + /* check if there is already an AS for this routing key */ + as = osmo_ss7_as_find_by_rctx(asp->inst, rctx); + } else { + /* if the ASP did not include a routing context number, allocate + * one locally (will be part of response) */ + rctx = osmo_ss7_find_free_rctx(asp->inst); + } + + LOGPASP(asp, DLSS7, LOGL_INFO, "RKM: Registering routing key %u for DPC %s\n", + rctx, osmo_ss7_pointcode_print(asp->inst, dpc)); if (!as && !asp->inst->cfg.permit_dyn_rkm_alloc) { /* not permitted to create dynamic RKM entries */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42531?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: I40719527c527db58244972a797c4287107306532 Gerrit-Change-Number: 42531 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: xua_find_as_for_asp(): Optimize lookup
by pespin 30 Mar '26

30 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42532?usp=email ) Change subject: xua_find_as_for_asp(): Optimize lookup ...................................................................... xua_find_as_for_asp(): Optimize lookup Instead of looking up on all AS configured in an instance, look up on the subset associated to the ASP we are looking up for. Since we are also not looking a 2nd pass to then validate if ASP and returned AS is related, in worst case this would split lookup complexity by half. Change-Id: If85ad27ad5e55be0c22e2716fa7329409a7b85b5 --- M src/xua_shared.c 1 file changed, 4 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/32/42532/1 diff --git a/src/xua_shared.c b/src/xua_shared.c index 0fa94c4..51cbbf2 100644 --- a/src/xua_shared.c +++ b/src/xua_shared.c @@ -58,21 +58,14 @@ *as = NULL; if (rctx_ie) { - uint32_t rctx = xua_msg_part_get_u32(rctx_ie); /* Use routing context IE to look up the AS for which the * message was received. */ - *as = osmo_ss7_as_find_by_rctx(asp->inst, rctx); + uint32_t rctx = xua_msg_part_get_u32(rctx_ie); + *as = ss7_asp_find_as_by_rctx(asp, rctx); if (!*as) { - LOGPASP(asp, log_ss, LOGL_ERROR, "%s(): invalid routing context: %u\n", - __func__, rctx); - return M3UA_ERR_INVAL_ROUT_CTX; - } - - /* Verify that this ASP is part of the AS. */ - if (!osmo_ss7_as_has_asp(*as, asp)) { LOGPASP(asp, log_ss, LOGL_ERROR, - "%s(): This Application Server Process is not part of the AS %s " - "resolved by routing context %u\n", __func__, (*as)->cfg.name, rctx); + "%s(): This Application Server Process is not serving any AS with routing context: %u\n", + __func__, rctx); return M3UA_ERR_NO_CONFGD_AS_FOR_ASP; } } else { -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42532?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: If85ad27ad5e55be0c22e2716fa7329409a7b85b5 Gerrit-Change-Number: 42532 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: handle_rkey_dereg(): Optimize lookup
by pespin 30 Mar '26

30 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42533?usp=email ) Change subject: handle_rkey_dereg(): Optimize lookup ...................................................................... handle_rkey_dereg(): Optimize lookup Instead of looking up on all AS configured in an instance, look up on the subset associated to the ASP we are looking up for. Since we are also not looking a 2nd pass to then validate if ASP and returned AS is related, in worst case this would split lookup complexity by half. Change-Id: I56ac5caef9bcded9dd08ca532a413af94070a1bd --- M src/xua_rkm.c 1 file changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/33/42533/1 diff --git a/src/xua_rkm.c b/src/xua_rkm.c index e9972b3..f3136e4 100644 --- a/src/xua_rkm.c +++ b/src/xua_rkm.c @@ -401,7 +401,7 @@ struct osmo_ss7_as *as; struct osmo_ss7_route *rt; - as = osmo_ss7_as_find_by_rctx(inst, rctx); + as = ss7_asp_find_as_by_rctx(asp, rctx); if (!as) { msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_INVAL_RCTX, 0); return -1; @@ -413,12 +413,6 @@ return -1; } - /* Reject if ASP is not even part of AS */ - if (!osmo_ss7_as_has_asp(as, asp)) { - msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_INVAL_RCTX, 0); - return -1; - } - /* Reject if ASP is still active */ if (asp->fi->state == XUA_ASP_S_ACTIVE) { msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_ASP_ACTIVE, 0); -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42533?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: I56ac5caef9bcded9dd08ca532a413af94070a1bd Gerrit-Change-Number: 42533 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: osmo_ss7_find_free_{rctx,l_rk_id}(): Make more robust to wrap-around
by pespin 30 Mar '26

30 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42534?usp=email ) Change subject: osmo_ss7_find_free_{rctx,l_rk_id}(): Make more robust to wrap-around ...................................................................... osmo_ss7_find_free_{rctx,l_rk_id}(): Make more robust to wrap-around Previous versions of those functions would end up broken over time after ~2^32 were allocated, turning the program into an unusuable stte. Change-Id: Ie10f4048d0af384dc84c79e6fc441c8537649d55 --- M src/ss7_instance.c 1 file changed, 24 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/34/42534/1 diff --git a/src/ss7_instance.c b/src/ss7_instance.c index 4aadc65..05f6be8 100644 --- a/src/ss7_instance.c +++ b/src/ss7_instance.c @@ -240,25 +240,41 @@ return false; } +/* Next RCTX, skipping special value "0" meaning no context. */ +static inline uint32_t rctx_inc(uint32_t rctx) +{ + return (rctx == UINT32_MAX) ? 1 : rctx + 1; +} + int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst) { - int32_t rctx; + uint32_t rctx = next_rctx; - for (rctx = next_rctx; rctx; rctx = ++next_rctx) { - if (!osmo_ss7_as_find_by_rctx(inst, next_rctx)) + OSMO_ASSERT(next_rctx != 0); + + do { + if (!osmo_ss7_as_find_by_rctx(inst, rctx)) { + next_rctx = rctx_inc(rctx); return rctx; - } + } + rctx = rctx_inc(rctx); + } while (rctx != next_rctx); + return -1; } uint32_t ss7_find_free_l_rk_id(struct osmo_ss7_instance *inst) { - uint32_t l_rk_id; + uint32_t l_rk_id = next_l_rk_id; - for (l_rk_id = next_l_rk_id; next_l_rk_id; l_rk_id = ++next_l_rk_id) { - if (!osmo_ss7_as_find_by_l_rk_id(inst, next_l_rk_id)) + do { + if (!osmo_ss7_as_find_by_l_rk_id(inst, l_rk_id)) { + next_l_rk_id = l_rk_id + 1; return l_rk_id; - } + } + l_rk_id++; + } while (l_rk_id != next_l_rk_id); + return -1; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42534?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: Ie10f4048d0af384dc84c79e6fc441c8537649d55 Gerrit-Change-Number: 42534 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: stp: m3ua: Fix incorrect RCTX being sent in TC_combinedlset_loadshare
by pespin 30 Mar '26

30 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42526?usp=email ) Change subject: stp: m3ua: Fix incorrect RCTX being sent in TC_combinedlset_loadshare ...................................................................... stp: m3ua: Fix incorrect RCTX being sent in TC_combinedlset_loadshare An ASPAC was being sent containing an RCTX of an unrelated AS to the sending ASP. Newer libosmo-sigtran properly validates AS/RCTX is associated to the ASP in the local config, and hence now returns an error properly making the test fail. Change-Id: Id8381a028a919a265ca330ef4f61c76637c168f6 --- M stp/STP_Tests_M3UA.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/26/42526/1 diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn index 485ca76..59839b0 100644 --- a/stp/STP_Tests_M3UA.ttcn +++ b/stp/STP_Tests_M3UA.ttcn @@ -1738,7 +1738,7 @@ } /* activate the second 'receiver' side ASP+AS */ - f_M3UA_asp_up_act(2, c_M3UA_TMT_override, rctx_receiver); + f_M3UA_asp_up_act(2, c_M3UA_TMT_override, rctx_receiver2); /* verify traffic is routed from sender to new receiver */ const integer iter_per_asp := 20; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42526?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Id8381a028a919a265ca330ef4f61c76637c168f6 Gerrit-Change-Number: 42526 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: transport: change APDU format paradigm
by laforge 30 Mar '26

30 Mar '26
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42441?usp=email ) Change subject: transport: change APDU format paradigm ...................................................................... transport: change APDU format paradigm Unfortunately we have mixed up the concept of TPDUs and APDUs in earlier versions of pySim-shell. This lead to problems with detecteding the APDU case properly (see also ISO/IEC 7816-3) and also prevented us from adding support for T=1. This problem has been fixed long time ago and all APDUs sent from the pySim-shell code should be well formed and valid according to ISO/IEC 7816-3. To ensure that we continue to format APDUs correctly as APDUs (and not TPDUs) we have added a mechanism to the LinkBase class that would either raise an exception or print a warning if someone mistakenly tries to send an APDU that is really a TPDU. Whether a warning is printed or an exception is raised is controlled via the apdu_strict member in the LinkBase class, which is false (print warning only) by default. The reason why we have implemneted the mechanism this way was because we wanted to ensure that existing APDU scripts (pySim-shell apdu command) keep working, even though when those scripts uses APDUs which are formally invalid. Sending a TPDU instead of an APDU via a T=0 link will still work in almost all cases. This is also the reason why this problem slipped through unnoticed for long time. However, there may still be subtile problems araising from this practice. The root of the problem is that it is impossible to distinguish between APDU case 3 and 4 when a TPDU instead of an APDU is sent. However in order to handle a case 4 APDU correctly we must be able to distinguish the APDU case correctly to handle the case correctly. ETSI TS 102 221, section 7.3.1.1.4, clause 4 is very clear about the fact that not (only) the status word (e.g. 61xx) but the APDU case is what matters. To complete the logic in LinkBaseTpdu and to maintain compatibility (older APDU scripts), we must still be able to switch between the 'apdu_strict' mode and the non-strict mode. However, since pySim-shell, pySim-prog and pySim-read internally use proper APDUs, we may enable the 'apdu_strict' mode by default. At the same time we will limit the effect of pySim-shell's apdu_strict setable to the apdu command only. By doing so, the bahviour of the apdu command is not altered. Users will still have to enable the 'strict' mode explicitly. At the same time all the internal functionality of pySim-shell will always use the 'strict' mode. Related: OS#6970 Change-Id: I9a531a825def318b28bf58291d811cf119003fab --- M pySim-shell.py M pySim/transport/__init__.py 2 files changed, 12 insertions(+), 11 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim-shell.py b/pySim-shell.py index 50deea2..2bfc720 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -136,8 +136,7 @@ self.add_settable(Settable2Compat('apdu_trace', bool, 'Trace and display APDUs exchanged with card', self, onchange_cb=self._onchange_apdu_trace)) self.add_settable(Settable2Compat('apdu_strict', bool, - 'Enforce APDU responses according to ISO/IEC 7816-3, table 12', self, - onchange_cb=self._onchange_apdu_strict)) + 'Strictly apply APDU format according to ISO/IEC 7816-3, table 12', self)) self.add_settable(Settable2Compat('verbose', bool, 'Enable/disable verbose logging', self, onchange_cb=self._onchange_verbose)) @@ -218,13 +217,6 @@ else: self.card._scc._tp.apdu_tracer = None - def _onchange_apdu_strict(self, param_name, old, new): - if self.card: - if new == True: - self.card._scc._tp.apdu_strict = True - else: - self.card._scc._tp.apdu_strict = False - def _onchange_verbose(self, param_name, old, new): PySimLogger.set_verbose(new) if new == True: @@ -281,7 +273,7 @@ apdu_cmd_parser.add_argument('--expect-sw', help='expect a specified status word', type=str, default=None) apdu_cmd_parser.add_argument('--expect-response-regex', help='match response against regex', type=str, default=None) apdu_cmd_parser.add_argument('--raw', help='Bypass the logical channel (and secure channel)', action='store_true') - apdu_cmd_parser.add_argument('APDU', type=is_hexstr, help='APDU as hex string') + apdu_cmd_parser.add_argument('APDU', type=is_hexstr, help='APDU as hex string (see also: ISO/IEC 7816-3, section 12.1') @cmd2.with_argparser(apdu_cmd_parser) def do_apdu(self, opts): @@ -290,14 +282,23 @@ tracked. Depending on the raw APDU sent, pySim-shell may not continue to work as expected if you e.g. select a different file.""" + if not hasattr(self, 'apdu_strict_warning_displayed') and self.apdu_strict is False: + self.poutput("Warning: The default for the setable parameter `apdu_strict` will be changed from") + self.poutput(" `False` to `True` in future pySim-shell releases. In case you are using") + self.poutput(" the `apdu` command from a script that still mixes APDUs with TPDUs, consider") + self.poutput(" fixing or adding a `set apdu_strict false` line at the beginning.") + self.apdu_strict_warning_displayed = True; + # When sending raw APDUs we access the scc object through _scc member of the card object. It should also be # noted that the apdu command plays an exceptional role since it is the only card accessing command that # can be executed without the presence of a runtime state (self.rs) object. However, this also means that # self.lchan is also not present (see method equip). + self.card._scc._tp.apdu_strict = self.apdu_strict if opts.raw or self.lchan is None: data, sw = self.card._scc.send_apdu(opts.APDU, apply_lchan = False) else: data, sw = self.lchan.scc.send_apdu(opts.APDU, apply_lchan = False) + self.card._scc._tp.apdu_strict = True if data: self.poutput("SW: %s, RESP: %s" % (sw, data)) else: diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index f19790c..6833a90 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -90,7 +90,7 @@ self.sw_interpreter = sw_interpreter self.apdu_tracer = apdu_tracer self.proactive_handler = proactive_handler - self.apdu_strict = False + self.apdu_strict = True @abc.abstractmethod def __str__(self) -> str: -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42441?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I9a531a825def318b28bf58291d811cf119003fab Gerrit-Change-Number: 42441 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: transport: change APDU format paradigm
by laforge 30 Mar '26

30 Mar '26
Attention is currently required from: daniel, dexter, fixeria, neels. laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/42441?usp=email ) Change subject: transport: change APDU format paradigm ...................................................................... Patch Set 2: Code-Review+2 (1 comment) Patchset: PS2: Sadly no codecreviewcdor an entire week -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42441?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I9a531a825def318b28bf58291d811cf119003fab Gerrit-Change-Number: 42441 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 30 Mar 2026 10:26:08 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • ...
  • 194
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.