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

May 2022

  • 2 participants
  • 1343 discussions
Change in osmo-ttcn3-hacks[master]: ggsn: Use larger MSISDN number
by laforge 04 May '22

04 May '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28029 ) Change subject: ggsn: Use larger MSISDN number ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28029 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I8a1eeb48efdddaa4f5466cdbe72545523ce31cb8 Gerrit-Change-Number: 28029 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 May 2022 10:08:04 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: pgw: Send MSISDN in GTPv2C CreateSessionRequest
by laforge 04 May '22

04 May '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28030 ) Change subject: pgw: Send MSISDN in GTPv2C CreateSessionRequest ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28030 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I71bcad944f40aa78357f2d11f54d139103ca3e24 Gerrit-Change-Number: 28030 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 May 2022 10:07:43 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: paging: Remove TODO comment
by laforge 04 May '22

04 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28031 ) Change subject: paging: Remove TODO comment ...................................................................... paging: Remove TODO comment That function is used to get the number of paging groups, so it doesn't apply here. Change-Id: I980c0961e86d9464235ea9c403adba6b0eded58e --- M src/osmo-bsc/paging.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 90a0d12..e7a0ee2 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -641,7 +641,6 @@ /*! Estimate available_slots credit over a time period, used when below CCCH Load Indication Threshold */ uint16_t paging_estimate_available_slots(struct gsm_bts *bts, unsigned int time_span_s) { - /* TODO: use gsm48_number_of_paging_subchannels() instead? */ unsigned int n_pag_blocks = gsm0502_get_n_pag_blocks(&bts->si_common.chan_desc); uint16_t available_slots = n_pag_blocks * time_span_s * 1000000 / GSM51_MFRAME_DURATION_us; LOG_BTS(bts, DPAG, LOGL_DEBUG, "Estimated %u paging available_slots over %u seconds\n", -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28031 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I980c0961e86d9464235ea9c403adba6b0eded58e Gerrit-Change-Number: 28031 Gerrit-PatchSet: 1 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-MessageType: merged
1 0
0 0
Change in osmo-bsc[master]: Drop duplicate function helper
by laforge 04 May '22

04 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28032 ) Change subject: Drop duplicate function helper ...................................................................... Drop duplicate function helper Change-Id: Idac049d07bf105b85a71af2f15f56552c453a370 --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 1 insertion(+), 11 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved laforge: Looks good to me, approved diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 3c8f381..12ddbd2 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -367,16 +367,6 @@ abis_rsl_chan_rqd_queue_flush(trx->bts); } -static void all_ts_dispatch_event(struct gsm_bts_trx *trx, uint32_t event) -{ - int ts_i; - for (ts_i = 0; ts_i < ARRAY_SIZE(trx->ts); ts_i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[ts_i]; - if (ts->fi) - osmo_fsm_inst_dispatch(ts->fi, event, 0); - } -} - struct osmo_timer_list update_connection_stats_timer; /* Periodically call bsc_update_connection_stats() to keep stat items updated. @@ -474,7 +464,7 @@ } else if (isd->link_type == E1INP_SIGN_RSL) { rate_ctr_inc(rate_ctr_group_get_ctr(trx->bts->bts_ctrs, BTS_CTR_BTS_RSL_FAIL)); acc_ramp_abort(&trx->bts->acc_ramp); - all_ts_dispatch_event(trx, TS_EV_RSL_DOWN); + gsm_trx_all_ts_dispatch(trx, TS_EV_RSL_DOWN, NULL); if (trx->nr == 0) osmo_timer_del(&trx->bts->cbch_timer); } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28032 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Idac049d07bf105b85a71af2f15f56552c453a370 Gerrit-Change-Number: 28032 Gerrit-PatchSet: 1 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-MessageType: merged
1 0
0 0
Change in osmo-bsc[master]: Drop duplicate function helper
by laforge 04 May '22

04 May '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28032 ) Change subject: Drop duplicate function helper ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28032 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Idac049d07bf105b85a71af2f15f56552c453a370 Gerrit-Change-Number: 28032 Gerrit-PatchSet: 1 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-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 May 2022 10:07:21 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: paging: Remove TODO comment
by laforge 04 May '22

04 May '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28031 ) Change subject: paging: Remove TODO comment ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28031 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I980c0961e86d9464235ea9c403adba6b0eded58e Gerrit-Change-Number: 28031 Gerrit-PatchSet: 1 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-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 04 May 2022 10:07:09 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-remsim[master]: encode actual hostname in RSPRO
by laforge 04 May '22

04 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/28020 ) Change subject: encode actual hostname in RSPRO ...................................................................... encode actual hostname in RSPRO The RSPRO ComponentIdentity includes a 'name' for each remsim component. So far we always used "fixme-name" instead of something meaningful. Let's use the hostname of the system instead. Change-Id: I14925f16ae242dae89fa853a2fe31c5c1b32981d --- M src/bankd/bankd_main.c M src/client/user_ifdhandler.c M src/server/remsim_server.c 3 files changed, 16 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified lynxis lazus: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c index d8dab03..8ec0966 100644 --- a/src/bankd/bankd_main.c +++ b/src/bankd/bankd_main.c @@ -59,6 +59,7 @@ __thread void *talloc_asn1_ctx; struct bankd *g_bankd; static void *g_tall_ctx; +static char g_hostname[256]; static void *worker_main(void *arg); @@ -91,7 +92,7 @@ bankd->srvc.bankd.num_slots = 8; bankd->comp_id.type = ComponentType_remsimBankd; - OSMO_STRLCPY_ARRAY(bankd->comp_id.name, "fixme-name"); + OSMO_STRLCPY_ARRAY(bankd->comp_id.name, g_hostname); OSMO_STRLCPY_ARRAY(bankd->comp_id.software, "remsim-bankd"); OSMO_STRLCPY_ARRAY(bankd->comp_id.sw_version, PACKAGE_VERSION); /* FIXME: other members of app_comp_id */ @@ -363,6 +364,9 @@ g_bankd = talloc_zero(NULL, struct bankd); OSMO_ASSERT(g_bankd); + if (gethostname(g_hostname, sizeof(g_hostname)) < 0) + OSMO_STRLCPY_ARRAY(g_hostname, "unknown"); + bankd_init(g_bankd); srvc = &g_bankd->srvc; @@ -370,7 +374,7 @@ srvc->server_port = 9998; srvc->handle_rx = bankd_srvc_handle_rx; srvc->own_comp_id.type = ComponentType_remsimBankd; - OSMO_STRLCPY_ARRAY(srvc->own_comp_id.name, "fixme-name"); + OSMO_STRLCPY_ARRAY(srvc->own_comp_id.name, g_hostname); OSMO_STRLCPY_ARRAY(srvc->own_comp_id.software, "remsim-bankd"); OSMO_STRLCPY_ARRAY(srvc->own_comp_id.sw_version, PACKAGE_VERSION); diff --git a/src/client/user_ifdhandler.c b/src/client/user_ifdhandler.c index 551db00..5704fba 100644 --- a/src/client/user_ifdhandler.c +++ b/src/client/user_ifdhandler.c @@ -125,7 +125,6 @@ /* configuration of client thread; passed in from IFD thread */ struct client_thread_cfg { - const char *name; const char *server_host; int server_port; int client_id; @@ -367,8 +366,12 @@ struct client_thread_cfg *cfg = arg; struct client_config *ccfg; struct client_thread *ct; + char hostname[256]; int rc; + if (gethostname(hostname, sizeof(hostname)) < 0) + OSMO_STRLCPY_ARRAY(hostname, "unknown"); + osmo_select_init(); rc = osmo_ctx_init("client"); OSMO_ASSERT(rc == 0); @@ -387,7 +390,7 @@ if (!talloc_asn1_ctx) talloc_asn1_ctx= talloc_named_const(ct, 0, "asn1"); - ct->bc = remsim_client_create(ct, cfg->name, "remsim_ifdhandler", ccfg); + ct->bc = remsim_client_create(ct, hostname, "remsim_ifdhandler", ccfg); OSMO_ASSERT(ct->bc); ct->bc->data = ct; @@ -560,7 +563,6 @@ { struct ifd_client *ic; struct client_thread_cfg cfg = { - .name = "fixme-name", .server_host = "127.0.0.1", .server_port = -1, .client_id = 0, diff --git a/src/server/remsim_server.c b/src/server/remsim_server.c index c2d54e5..71590f4 100644 --- a/src/server/remsim_server.c +++ b/src/server/remsim_server.c @@ -80,9 +80,13 @@ int main(int argc, char **argv) { + char hostname[256]; void *talloc_rest_ctx; int rc; + if (gethostname(hostname, sizeof(hostname)) < 0) + OSMO_STRLCPY_ARRAY(hostname, "unknown"); + g_tall_ctx = talloc_named_const(NULL, 0, "global"); talloc_asn1_ctx = talloc_named_const(g_tall_ctx, 0, "asn1"); talloc_rest_ctx = talloc_named_const(g_tall_ctx, 0, "rest"); @@ -106,7 +110,7 @@ goto out_rspro; g_rps->comp_id.type = ComponentType_remsimServer; - OSMO_STRLCPY_ARRAY(g_rps->comp_id.name, "fixme-name"); + OSMO_STRLCPY_ARRAY(g_rps->comp_id.name, hostname); OSMO_STRLCPY_ARRAY(g_rps->comp_id.software, "remsim-server"); OSMO_STRLCPY_ARRAY(g_rps->comp_id.sw_version, PACKAGE_VERSION); /* FIXME: other members of app_comp_id */ -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/28020 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: I14925f16ae242dae89fa853a2fe31c5c1b32981d Gerrit-Change-Number: 28020 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-remsim[master]: cosmetic: various typo/spelling fixes
by laforge 04 May '22

04 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/28022 ) Change subject: cosmetic: various typo/spelling fixes ...................................................................... cosmetic: various typo/spelling fixes Change-Id: Idc4db138d83be0c7c0b0ff6dfbb9f094b21d6fa9 --- M src/bankd/bankd_main.c M src/client/main_fsm.c M src/client/user_ifdhandler.c M src/rspro_client_fsm.c 4 files changed, 6 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified lynxis lazus: Looks good to me, approved diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c index 8ec0966..8c1c9a8 100644 --- a/src/bankd/bankd_main.c +++ b/src/bankd/bankd_main.c @@ -82,7 +82,7 @@ asn_debug = 0; - /* intialize members of 'bankd' */ + /* initialize members of 'bankd' */ bankd->slotmaps = slotmap_init(bankd); INIT_LLIST_HEAD(&bankd->workers); pthread_mutex_init(&bankd->workers_mutex, NULL); diff --git a/src/client/main_fsm.c b/src/client/main_fsm.c index f8b1406..0aa7429 100644 --- a/src/client/main_fsm.c +++ b/src/client/main_fsm.c @@ -70,7 +70,7 @@ env[i++] = talloc_asprintf(env, "REMSIM_CAUSE=%s", cause); - /* ask frontend to append any frontend-speccific additional environment vars */ + /* ask frontend to append any frontend-specific additional environment vars */ rc = frontend_append_script_env(bc, env, i, 256-i-1); if (rc > 0) i = rc; diff --git a/src/client/user_ifdhandler.c b/src/client/user_ifdhandler.c index 5704fba..5e7fb7a 100644 --- a/src/client/user_ifdhandler.c +++ b/src/client/user_ifdhandler.c @@ -111,7 +111,7 @@ void __thread *talloc_asn1_ctx; struct client_thread { - /* bankd client runningi inside this thread */ + /* bankd client running inside this thread */ struct bankd_client *bc; /* inter-thread osmo-fd; communication with IFD/PCSC thread */ @@ -132,7 +132,7 @@ int it_sock_fd; }; -/* enqueue a msgb (containg 'struct itmsg') towards the IFD-handler thread */ +/* enqueue a msgb (containing 'struct itmsg') towards the IFD-handler thread */ static void enqueue_to_ifd(struct client_thread *ct, struct msgb *msg) { if (!msg) diff --git a/src/rspro_client_fsm.c b/src/rspro_client_fsm.c index c0336b7..bd07330 100644 --- a/src/rspro_client_fsm.c +++ b/src/rspro_client_fsm.c @@ -94,11 +94,11 @@ } enum server_conn_fsm_state { - /* waiting for initial connectiong to remsim-server */ + /* waiting for initial connection to remsim-server */ SRVC_ST_INIT, /* server connection established, waiting for ClientConnectRes */ SRVC_ST_ESTABLISHED, - /* server connection etsablished, ClientConnect succeeded */ + /* server connection established, ClientConnect succeeded */ SRVC_ST_CONNECTED, /* connection lost, we're waiting for a re-establish */ SRVC_ST_REESTABLISH, 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/28022 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: Idc4db138d83be0c7c0b0ff6dfbb9f094b21d6fa9 Gerrit-Change-Number: 28022 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-remsim[master]: server: Fix various error paths if startup fails
by laforge 04 May '22

04 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/28028 ) Change subject: server: Fix various error paths if startup fails ...................................................................... server: Fix various error paths if startup fails Don't segfault or use heap after free if osmo-remsim-server cannot fully initialize, e.g. due to ports already in use. Change-Id: I558e6a0ea089a779f916aa5576341d1c55da1271 --- M src/server/remsim_server.c M src/server/rest_api.c M src/server/rspro_server.c 3 files changed, 7 insertions(+), 1 deletion(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/server/remsim_server.c b/src/server/remsim_server.c index 71590f4..419dcad 100644 --- a/src/server/remsim_server.c +++ b/src/server/remsim_server.c @@ -139,7 +139,6 @@ close(g_event_ofd.fd); out_rps: talloc_free(g_rps->slotmaps); - talloc_free(g_rps); out_rspro: rspro_server_destroy(g_rps); diff --git a/src/server/rest_api.c b/src/server/rest_api.c index 540fbd4..d3279c4 100644 --- a/src/server/rest_api.c +++ b/src/server/rest_api.c @@ -512,6 +512,7 @@ if (ulfius_start_framework(&g_instance) != U_OK) { LOGP(DREST, LOGL_FATAL, "Cannot start REST API on port %u\n", port); + ulfius_clean_instance(&g_instance); return -1; } return 0; diff --git a/src/server/rspro_server.c b/src/server/rspro_server.c index 7ce99c9..550179d 100644 --- a/src/server/rspro_server.c +++ b/src/server/rspro_server.c @@ -854,6 +854,11 @@ pthread_rwlock_unlock(&srv->rwlock); srv->link = ipa_server_link_create(ctx, NULL, host, port, accept_cb, srv); + if (!srv->link) { + talloc_free(srv); + return NULL; + } + ipa_server_link_open(srv->link); return srv; @@ -865,5 +870,6 @@ ipa_server_link_destroy(srv->link); srv->link = NULL; + pthread_rwlock_destroy(&srv->rwlock); talloc_free(srv); } -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/28028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: I558e6a0ea089a779f916aa5576341d1c55da1271 Gerrit-Change-Number: 28028 Gerrit-PatchSet: 3 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-remsim[master]: server: Detect duplicate client/bankd connection; drop new ones
by laforge 04 May '22

04 May '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/28027 ) Change subject: server: Detect duplicate client/bankd connection; drop new ones ...................................................................... server: Detect duplicate client/bankd connection; drop new ones we're dropping the current (new) connection as we don't really know which is the "right" one. Dropping the new gives the old connection time to timeout, or to continue to operate. If we were to drop the old connection, this could interrupt a perfectly working connection and opens some kind of DoS. Related: OS#5527 Change-Id: I00387dbc19d689415470e2f08df08a47a78b81c0 --- M asn1/RSPRO.asn M include/osmocom/rspro/ResultCode.h M src/rspro/ResultCode.c M src/server/rspro_server.c 4 files changed, 61 insertions(+), 13 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/asn1/RSPRO.asn b/asn1/RSPRO.asn index d49345d..7cba1b9 100644 --- a/asn1/RSPRO.asn +++ b/asn1/RSPRO.asn @@ -87,6 +87,7 @@ illegalSlotId (3), unsupportedProtocolVersion (4), unknownSlotmap (5), + identityInUse (6), -- no card is present in given slot cardNotPresent (100), diff --git a/include/osmocom/rspro/ResultCode.h b/include/osmocom/rspro/ResultCode.h index 1342990..9a2cbd2 100644 --- a/include/osmocom/rspro/ResultCode.h +++ b/include/osmocom/rspro/ResultCode.h @@ -25,6 +25,7 @@ ResultCode_illegalSlotId = 3, ResultCode_unsupportedProtocolVersion = 4, ResultCode_unknownSlotmap = 5, + ResultCode_identityInUse = 6, ResultCode_cardNotPresent = 100, ResultCode_cardUnresponsive = 101, ResultCode_cardTransmissionError = 102 diff --git a/src/rspro/ResultCode.c b/src/rspro/ResultCode.c index f60bf0c..76ca2fa 100644 --- a/src/rspro/ResultCode.c +++ b/src/rspro/ResultCode.c @@ -89,15 +89,17 @@ { 3, 13, "illegalSlotId" }, { 4, 26, "unsupportedProtocolVersion" }, { 5, 14, "unknownSlotmap" }, + { 6, 13, "identityInUse" }, { 100, 14, "cardNotPresent" }, { 101, 16, "cardUnresponsive" }, { 102, 21, "cardTransmissionError" } /* This list is extensible */ }; static const unsigned int asn_MAP_ResultCode_enum2value_1[] = { - 6, /* cardNotPresent(100) */ - 8, /* cardTransmissionError(102) */ - 7, /* cardUnresponsive(101) */ + 7, /* cardNotPresent(100) */ + 9, /* cardTransmissionError(102) */ + 8, /* cardUnresponsive(101) */ + 6, /* identityInUse(6) */ 2, /* illegalBankId(2) */ 1, /* illegalClientId(1) */ 3, /* illegalSlotId(3) */ @@ -109,8 +111,8 @@ static const asn_INTEGER_specifics_t asn_SPC_ResultCode_specs_1 = { asn_MAP_ResultCode_value2enum_1, /* "tag" => N; sorted by tag */ asn_MAP_ResultCode_enum2value_1, /* N => "tag"; sorted by N */ - 9, /* Number of elements in the maps */ - 10, /* Extensions before this member */ + 10, /* Number of elements in the maps */ + 11, /* Extensions before this member */ 1, /* Strict enumeration */ 0, /* Native long size */ 0 diff --git a/src/server/rspro_server.c b/src/server/rspro_server.c index c4d4d79..7ce99c9 100644 --- a/src/server/rspro_server.c +++ b/src/server/rspro_server.c @@ -76,6 +76,7 @@ CLNTC_ST_WAIT_CONF_RES, /* waiting for ConfigClientRes */ CLNTC_ST_CONNECTED_BANKD, CLNTC_ST_CONNECTED_CLIENT, + CLNTC_ST_REJECTED, }; enum remsim_server_client_event { @@ -119,6 +120,7 @@ static void clnt_st_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct rspro_client_conn *conn = fi->priv; + struct rspro_client_conn *previous_conn; const RsproPDU_t *pdu = data; const ConnectClientReq_t *cclreq = NULL; const ConnectBankReq_t *cbreq = NULL; @@ -141,11 +143,6 @@ return; } - /* reparent us from srv->connections to srv->clients */ - pthread_rwlock_wrlock(&conn->srv->rwlock); - llist_del(&conn->list); - llist_add_tail(&conn->list, &conn->srv->clients); - pthread_rwlock_unlock(&conn->srv->rwlock); if (!cclreq->clientSlot) { #if 0 @@ -161,7 +158,6 @@ osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); #endif } else { - /* FIXME: check for unique-ness */ rspro2client_slot(&conn->client.slot, cclreq->clientSlot); osmo_fsm_inst_update_id_f(fi, "C%u:%u", conn->client.slot.client_id, conn->client.slot.slot_nr); @@ -169,6 +165,30 @@ conn->client.slot.client_id, conn->client.slot.slot_nr); LOGPFSML(fi, LOGL_INFO, "Client connected from %s:%s\n", ip_str, port_str); + + /* check for unique-ness */ + previous_conn = client_conn_by_slot(conn->srv, &conn->client.slot); + if (previous_conn && previous_conn != conn) { + /* we're dropping the current (new) connection as we don't really know which + * is the "right" one. Dropping the new gives the old connection time to + * timeout, or to continue to operate. If we were to drop the old + * connection, this could interrupt a perfectly working connection and opens + * some kind of DoS. */ + LOGPFSML(fi, LOGL_ERROR, "New client connection from %s:%s, but we already " + "have a connection from %s:%u. Dropping new connection.\n", + ip_str, port_str, previous_conn->peer->addr, previous_conn->peer->port); + resp = rspro_gen_ConnectClientRes(&conn->srv->comp_id, ResultCode_identityInUse); + client_conn_send(conn, resp); + osmo_fsm_inst_state_chg(fi, CLNTC_ST_REJECTED, 1, 2); + return; + } + + /* reparent us from srv->connections to srv->clients */ + pthread_rwlock_wrlock(&conn->srv->rwlock); + llist_del(&conn->list); + llist_add_tail(&conn->list, &conn->srv->clients); + pthread_rwlock_unlock(&conn->srv->rwlock); + resp = rspro_gen_ConnectClientRes(&conn->srv->comp_id, ResultCode_ok); client_conn_send(conn, resp); osmo_fsm_inst_state_chg(fi, CLNTC_ST_CONNECTED_CLIENT, 0, 0); @@ -183,7 +203,6 @@ osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); return; } - /* FIXME: check for unique-ness */ conn->bank.bank_id = cbreq->bankId; conn->bank.num_slots = cbreq->numberOfSlots; osmo_fsm_inst_update_id_f(fi, "B%u", conn->bank.bank_id); @@ -196,6 +215,23 @@ "as they must be able to reach the bankd!\n", ip_str); } + /* check for unique-ness */ + previous_conn = bankd_conn_by_id(conn->srv, conn->bank.bank_id); + if (previous_conn && previous_conn != conn) { + /* we're dropping the current (new) connection as we don't really know which + * is the "right" one. Dropping the new gives the old connection time to + * timeout, or to continue to operate. If we were to drop the old + * connection, this could interrupt a perfectly working connection and opens + * some kind of DoS. */ + LOGPFSML(fi, LOGL_ERROR, "New bankd connection from %s:%s, but we already " + "have a connection from %s:%u. Dropping new connection.\n", + ip_str, port_str, previous_conn->peer->addr, previous_conn->peer->port); + resp = rspro_gen_ConnectBankRes(&conn->srv->comp_id, ResultCode_identityInUse); + client_conn_send(conn, resp); + osmo_fsm_inst_state_chg(fi, CLNTC_ST_REJECTED, 1, 2); + return; + } + /* reparent us from srv->connections to srv->banks */ pthread_rwlock_wrlock(&conn->srv->rwlock); llist_del(&conn->list); @@ -445,6 +481,10 @@ case 1: /* No ClientConnectReq received:disconnect */ return 1; /* ask core to terminate FSM */ + case 2: + /* Timeout after rejecting client */ + LOGPFSML(fi, LOGL_NOTICE, "Closing connection of rejected peer\n"); + return 1; /* ask core to terminate FSM */ default: OSMO_ASSERT(0); } @@ -471,7 +511,7 @@ .name = "ESTABLISHED", .in_event_mask = S(CLNTC_E_CLIENT_CONN) | S(CLNTC_E_BANK_CONN), .out_state_mask = S(CLNTC_ST_CONNECTED_CLIENT) | S(CLNTC_ST_WAIT_CONF_RES) | - S(CLNTC_ST_CONNECTED_BANKD), + S(CLNTC_ST_CONNECTED_BANKD) | S(CLNTC_ST_REJECTED), .action = clnt_st_established, }, [CLNTC_ST_WAIT_CONF_RES] = { @@ -493,6 +533,10 @@ .action = clnt_st_connected_bankd, .onenter = clnt_st_connected_bankd_onenter, }, + [CLNTC_ST_REJECTED] = { + .name = "REJECTED", + /* no events permitted, no action required */ + } }; -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/28027 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: I00387dbc19d689415470e2f08df08a47a78b81c0 Gerrit-Change-Number: 28027 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • ...
  • 135
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.