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

September 2026

  • 1 participants
  • 1894 discussions
[L] Change in pysim[master]: bip: move the BIP relay into pySim.bip
by dexter 08 Sep '26

08 Sep '26
Attention is currently required from: Hoernchen. dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43540?usp=email ) Change subject: bip: move the BIP relay into pySim.bip ...................................................................... Patch Set 2: Code-Review+1 (3 comments) Patchset: PS2: Ths patch had no "Verifed" result, I have re-triggered the Jenkins build, but the build seems to take very long. I hope it will finish overnight... File tests/unittests/test_bip_relay.py: https://gerrit.osmocom.org/c/pysim/+/43540/comment/923712bf_c3f471e4?usp=em… : PS1, Line 28: with a card that sends one, and one that has one must get the PDU.""" I only see sms_sink? Were there crashes before, did you change the code when moving it to the bip module? https://gerrit.osmocom.org/c/pysim/+/43540/comment/f203b9f7_0ac00edf?usp=em… : PS1, Line 40: Proact(sms_sink=seen.append).send_sms_via_smpp(self._submit()) maybe create the Proact object first and use it then. Maybe also assert on it to make sure the constructor has stored the sms_sink callback as class property? -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43540?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: Ifd8a15684939977d29ea83a6b669daee14484e88 Gerrit-Change-Number: 43540 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Tue, 08 Sep 2026 15:24:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[L] Change in pysim[master]: ota: add TS 102 226 5.2 Expanded Remote Application data format
by dexter 08 Sep '26

08 Sep '26
Attention is currently required from: Hoernchen, daniel. dexter has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/pysim/+/43541?usp=email ) Change subject: ota: add TS 102 226 5.2 Expanded Remote Application data format ...................................................................... Patch Set 2: Code-Review+1 (4 comments) Patchset: PS2: This is really a lot of stuff, however the testcases look comprehensive. I think this is ok. File pySim/ota.py: https://gerrit.osmocom.org/c/pysim/+/43541/comment/7e48dc08_d9457744?usp=em… : PS2, Line 120: Looks like a spec ref is missing here? (TS 102 226 5.2.1 as it seems) https://gerrit.osmocom.org/c/pysim/+/43541/comment/fd096896_42e464c6?usp=em… : PS2, Line 323: I would recommend to add API docstrings for the other parameters, in particular the apdu parameter, which now can also be a list of APDUs. https://gerrit.osmocom.org/c/pysim/+/43541/comment/c6b1a88c_e552ac3c?usp=em… : PS2, Line 333: same here, I think we should document all parameters. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/43541?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: Idec00d16fd1a7d4a7129b2a3b6f0ef37dabcecb7 Gerrit-Change-Number: 43541 Gerrit-PatchSet: 2 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Tue, 08 Sep 2026 15:23:14 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-iuh[master]: hnb-test: use N(SD)=1 on MM Auth Response
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/43590?usp=email ) Change subject: hnb-test: use N(SD)=1 on MM Auth Response ...................................................................... hnb-test: use N(SD)=1 on MM Auth Response The Authentication Response carries a hard-coded N(SD) of 2 in the message type octet: 0x80 | GSM48_MT_MM_AUTH_RESP, with the comment "simulate sequence nr 2". That predates the duplicate detection of 3GPP TS 24.007 section 11.2.3.2.3 in osmo-msc. The Location Updating Request that opens the connection in the InitialUE-Message is N(SD) = 0, so the Authentication Response, being the second uplink MM message, has to be N(SD) = 1. With 2, osmo-msc logs Duplicate DTAP: bin=0, expected n_sd == 1, got 2 drops the response, and rejects the Location Update when its timer expires. Set N(SD) to 1 so the response reaches the VLR. The remaining uplink MM messages are handled later in this series. Change-Id: I4c71b404733e53d4e47d9ba5eb555b92eb1a771d Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M tests/hnb-test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/90/43590/1 diff --git a/tests/hnb-test.c b/tests/hnb-test.c index bfccf5a..597d04f 100644 --- a/tests/hnb-test.c +++ b/tests/hnb-test.c @@ -220,7 +220,7 @@ { uint8_t id_resp[] = { GSM48_PDISC_MM, - 0x80 | GSM48_MT_MM_AUTH_RESP, /* simulate sequence nr 2 */ + 0x40 | GSM48_MT_MM_AUTH_RESP, /* N(SD) = 1: second uplink MM message after the LU Request */ 0x61, 0xb5, 0x69, 0xf5 /* hardcoded SRES */ }; -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/43590?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: I4c71b404733e53d4e47d9ba5eb555b92eb1a771d Gerrit-Change-Number: 43590 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[S] Change in osmo-iuh[master]: hnb-test: parse LU Accept IEs after the LAI
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/43592?usp=email ) Change subject: hnb-test: parse LU Accept IEs after the LAI ...................................................................... hnb-test: parse LU Accept IEs after the LAI The Location Updating Accept begins with the mandatory Location Area Identification, a five octet V IE (3GPP TS 24.008 section 9.2.13). The optional TLV IEs, among them the Mobile Identity carrying a new TMSI, start after it. hnb-test handed the whole message body to tlv_parse(), which read the first LAI octet as an IEI and failed with OSMO_TLVP_ERR_UNKNOWN_TLV_TYPE. The TMSI Reallocation Complete was therefore never sent, and osmo-msc, which allocates a TMSI by default, released the connection with a Location Updating Reject when its timer expired. Start the parser after the LAI, and read the identity type from the Mobile Identity IE instead of the Network Name IE, which is not present in this message and would have been dereferenced as NULL. Change-Id: I2e1eb8e1bc3db5f20b04a3161713c8a47847c6dc Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M tests/hnb-test.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/92/43592/1 diff --git a/tests/hnb-test.c b/tests/hnb-test.c index 6eca9df..be9f170 100644 --- a/tests/hnb-test.c +++ b/tests/hnb-test.c @@ -298,14 +298,20 @@ int parse_res; len -= (const char *)&gh->data[0] - (const char *)gh; - parse_res = tlv_parse(&tp, &gsm48_mm_att_tlvdef, &gh->data[0], len, 0, 0); + + /* The Location Area Identification is a mandatory V IE of five octets + * at the start of the message body (TS 24.008 section 9.2.13); the + * TLV parser must start after it, or it takes the first LAI octet for + * an unknown IEI and fails. */ + parse_res = tlv_parse(&tp, &gsm48_mm_att_tlvdef, &gh->data[sizeof(*lai)], + len - sizeof(*lai), 0, 0); if (parse_res <= 0) { printf("Error parsing Location Update Accept message: %d\n", parse_res); return -1; } if (TLVP_PRESENT(&tp, GSM48_IE_MOBILE_ID)) { - uint8_t type = TLVP_VAL(&tp, GSM48_IE_NAME_SHORT)[0] & 0x0f; + uint8_t type = TLVP_VAL(&tp, GSM48_IE_MOBILE_ID)[0] & 0x0f; if (type == GSM_MI_TYPE_TMSI) *sent_tmsi = 1; else *sent_tmsi = 0; -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/43592?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: I2e1eb8e1bc3db5f20b04a3161713c8a47847c6dc Gerrit-Change-Number: 43592 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[M] Change in osmo-iuh[master]: hnb-test: answer UMTS AKA with the full RES
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/43591?usp=email ) Change subject: hnb-test: answer UMTS AKA with the full RES ...................................................................... hnb-test: answer UMTS AKA with the full RES On UTRAN the MSC only accepts UMTS AKA. hnb-test computed a COMP128v1 SRES for every challenge, and osmo-msc rejected the four octet answer with "AUTH via UTRAN, cannot allow GSM AKA", so the Location Update never passed authentication. Detect the AUTN IE in the MM Authentication Request. When it is there, compute the Milenage RES (K is the existing test key, OP is 0) and send it the way a UE does, per 3GPP TS 24.008 section 9.2.3: the first four octets in the mandatory SRES field, the rest in the Authentication Response Parameter extension IE. Without AUTN, keep the GSM AKA answer. The computation is shared with the GMM handlers added later in this series. Replies so far went out on the CS signalling connection only. Record the PS channel opened by "channel ps ...", let the RUA layer set the current channel from the CN domain indicator of each DirectTransfer, and reply on that one, so a PS connection can answer a challenge from the SGSN. Forget a channel when the CN sends RUA Disconnect, so a later "channel" command can open a new connection. Change-Id: Ida588b3ea93c51196fb3a29ed9544dfc4fe4fc30 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M tests/hnb-test-layers.h M tests/hnb-test-rua.c M tests/hnb-test.c M tests/hnb-test.h 4 files changed, 159 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/91/43591/1 diff --git a/tests/hnb-test-layers.h b/tests/hnb-test-layers.h index 6211661..a165dcf 100644 --- a/tests/hnb-test-layers.h +++ b/tests/hnb-test-layers.h @@ -7,6 +7,7 @@ /* main calls RUA */ void hnb_test_rua_dt_handle(struct hnb_test *hnb, struct ANY *in); void hnb_test_rua_cl_handle(struct hnb_test *hnb, struct ANY *in); +void hnb_test_rua_disc_handle(struct hnb_test *hnb, struct ANY *in); /* RUA calls RANAP */ void hnb_test_rua_dt_handle_ranap(void *priv, struct ranap_message_s *ranap_msg); @@ -17,3 +18,7 @@ void hnb_test_rx_secmode_cmd(struct hnb_test *hnb, long ip_alg); void hnb_test_rx_iu_release(struct hnb_test *hnb); void hnb_test_rx_paging(struct hnb_test *hnb, const char *imsi); + +/* authentication answer shared by the MM and GMM handlers (hnb-test.c) */ +extern const uint8_t hnb_test_subscr_key[16]; +int hnb_test_auth_answer(const uint8_t *rand, const uint8_t *autn, uint8_t *res, size_t res_size); diff --git a/tests/hnb-test-rua.c b/tests/hnb-test-rua.c index 0882515..b84087c 100644 --- a/tests/hnb-test-rua.c +++ b/tests/hnb-test-rua.c @@ -1,8 +1,10 @@ #include <asn1c/ANY.h> +#include <osmocom/core/talloc.h> #include <osmocom/ranap/ranap_common_cn.h> #include <osmocom/rua/rua_ies_defs.h> +#include "hnb-test.h" #include "hnb-test-layers.h" void hnb_test_rua_dt_handle(struct hnb_test *hnb, ANY_t *in) @@ -16,12 +18,49 @@ return; } + /* Tell the RANAP/NAS layer which signalling connection this belongs + * to, so that replies go back on the CS or the PS connection. */ + if (ies.cN_DomainIndicator == RUA_CN_DomainIndicator_ps_domain) + hnb->cur_chan = hnb->ps.chan; + else + hnb->cur_chan = hnb->cs.chan; + rc = ranap_cn_rx_co(hnb_test_rua_dt_handle_ranap, hnb, ies.ranaP_Message.buf, ies.ranaP_Message.size); + hnb->cur_chan = NULL; + /* FIXME: what to do with the asn1c-allocated memory */ rua_free_directtransferies(&ies); } +/* The CN released the signalling connection: forget the channel so that a + * new "channel" VTY command can open another one for that domain. */ +void hnb_test_rua_disc_handle(struct hnb_test *hnb, ANY_t *in) +{ + RUA_DisconnectIEs_t ies; + int rc; + + rc = rua_decode_disconnecties(&ies, in); + if (rc < 0) { + printf("failed to decode RUA Disconnect IEs\n"); + return; + } + + if (ies.cN_DomainIndicator == RUA_CN_DomainIndicator_ps_domain) { + printf("RUA Disconnect on the PS domain\n"); + if (hnb->ps.chan) + talloc_free(hnb->ps.chan); + hnb->ps.chan = NULL; + } else { + printf("RUA Disconnect on the CS domain\n"); + if (hnb->cs.chan) + talloc_free(hnb->cs.chan); + hnb->cs.chan = NULL; + } + + rua_free_disconnecties(&ies); +} + void hnb_test_rua_cl_handle(struct hnb_test *hnb, ANY_t *in) { RUA_ConnectionlessTransferIEs_t ies; diff --git a/tests/hnb-test.c b/tests/hnb-test.c index 597d04f..6eca9df 100644 --- a/tests/hnb-test.c +++ b/tests/hnb-test.c @@ -216,17 +216,31 @@ return ranap_new_msg_dt(0, id_resp, sizeof(id_resp)); } -static struct msgb *gen_nas_auth_resp(uint8_t *sres) +/* MM Authentication Response, 3GPP TS 24.008 section 9.2.3. For GSM AKA + * only the four octet SRES is present. For UMTS AKA the first four octets + * of RES go into that field and the rest into the Authentication Response + * Parameter (extension) IE, as a UE does. The message type octet carries + * N(SD) = 1: it is the second uplink MM message on the connection, after + * the Location Updating Request (TS 24.007 section 11.2.3.2.3). */ +static struct msgb *gen_nas_auth_resp(const uint8_t *res, unsigned int res_len) { - uint8_t id_resp[] = { - GSM48_PDISC_MM, - 0x40 | GSM48_MT_MM_AUTH_RESP, /* N(SD) = 1: second uplink MM message after the LU Request */ - 0x61, 0xb5, 0x69, 0xf5 /* hardcoded SRES */ - }; + uint8_t buf[2 + 4 + 2 + 12]; + unsigned int len = 0; - memcpy(id_resp + 2, sres, 4); + OSMO_ASSERT(res_len >= 4 && res_len <= 16); - return ranap_new_msg_dt(0, id_resp, sizeof(id_resp)); + buf[len++] = GSM48_PDISC_MM; + buf[len++] = 0x40 | GSM48_MT_MM_AUTH_RESP; + memcpy(buf + len, res, 4); + len += 4; + if (res_len > 4) { + buf[len++] = GSM48_IE_AUTH_RES_EXT; + buf[len++] = res_len - 4; + memcpy(buf + len, res + 4, res_len - 4); + len += res_len - 4; + } + + return ranap_new_msg_dt(0, buf, len); } static int hnb_test_tx_dt(struct hnb_test *hnb, struct msgb *txm) @@ -234,9 +248,12 @@ struct hnbtest_chan *chan; struct msgb *rua; - chan = hnb->cs.chan; + /* Reply on the connection the message being handled arrived on; + * outside of a receive path fall back to the CS connection. */ + chan = hnb->cur_chan ? hnb->cur_chan : hnb->cs.chan; if (!chan) { - printf("hnb_test_nas_tx_tmsi_realloc_compl(): No CS channel established yet.\n"); + printf("hnb_test_tx_dt(): No signalling connection established yet.\n"); + msgb_free(txm); return -1; } @@ -320,10 +337,77 @@ } } +/* Secret of the test subscriber: Ki for GSM AKA (COMP128v1) and K for + * UMTS AKA (Milenage, OP = 0). The same 16 octets are used for both so + * that one HLR entry serves both algorithms. */ +const uint8_t hnb_test_subscr_key[16] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f +}; + +/* Compute the answer to an authentication challenge. With an AUTN the + * challenge is UMTS AKA and the answer is the full RES from Milenage; + * without one it is GSM AKA and the answer is the SRES from COMP128v1. + * Returns the length of the answer written to res, or negative. */ +int hnb_test_auth_answer(const uint8_t *rand, const uint8_t *autn, + uint8_t *res, size_t res_size) +{ + struct osmo_auth_vector vec; + struct osmo_sub_auth_data2 auth; + int rc; + + memset(&vec, 0, sizeof(vec)); + memset(&auth, 0, sizeof(auth)); + + if (autn) { + /* Milenage wants the RES length it shall produce (4 or 8) */ + vec.res_len = 8; + auth.type = OSMO_AUTH_TYPE_UMTS; + auth.algo = OSMO_AUTH_ALG_MILENAGE; + memcpy(auth.u.umts.k, hnb_test_subscr_key, sizeof(hnb_test_subscr_key)); + auth.u.umts.k_len = sizeof(hnb_test_subscr_key); + auth.u.umts.opc_len = 16; /* OP = 0, derived to OPc */ + auth.u.umts.opc_is_op = 1; + auth.u.umts.ind_bitlen = 5; + } else { + auth.type = OSMO_AUTH_TYPE_GSM; + auth.algo = OSMO_AUTH_ALG_COMP128v1; + memcpy(auth.u.gsm.ki, hnb_test_subscr_key, sizeof(hnb_test_subscr_key)); + } + + rc = osmo_auth_gen_vec2(&vec, &auth, rand); + if (rc < 0) { + printf("osmo_auth_gen_vec2() failed: %d\n", rc); + return rc; + } + + if (autn) { + if (vec.res_len > res_size) + return -ENOSPC; + memcpy(res, vec.res, vec.res_len); + printf("UMTS AKA: rand %s", osmo_hexdump_nospc(rand, 16)); + printf(" autn %s", osmo_hexdump_nospc(autn, 16)); + printf(" --> res %s\n", osmo_hexdump_nospc(vec.res, vec.res_len)); + return vec.res_len; + } + + if (res_size < sizeof(vec.sres)) + return -ENOSPC; + memcpy(res, vec.sres, sizeof(vec.sres)); + printf("GSM AKA: rand %s", osmo_hexdump_nospc(rand, 16)); + printf(" --> sres %s\n", osmo_hexdump_nospc(vec.sres, sizeof(vec.sres))); + return sizeof(vec.sres); +} + static int hnb_test_nas_rx_auth_req(struct hnb_test *hnb, struct gsm48_hdr *gh, int len) { struct gsm48_auth_req *ar; + const uint8_t *autn = NULL; + const uint8_t *ie; + int ie_len; + uint8_t res[16]; + int res_len; len -= (const char *)&gh->data[0] - (const char *)gh; @@ -335,30 +419,21 @@ printf(" :) Authentication Request :)\n"); ar = (struct gsm48_auth_req*) &gh->data[0]; - int seq = ar->key_seq; - /* Generate SRES from *HARDCODED* Ki for Iuh testing */ - struct osmo_auth_vector vec; - /* Ki 000102030405060708090a0b0c0d0e0f */ - struct osmo_sub_auth_data2 auth = { - .type = OSMO_AUTH_TYPE_GSM, - .algo = OSMO_AUTH_ALG_COMP128v1, - .u.gsm.ki = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, - 0x0e, 0x0f - }, - }; + /* Optional AUTN (TLV, IEI 0x20) after the fixed part marks a UMTS + * AKA challenge, TS 24.008 section 9.2.2. */ + ie = &gh->data[sizeof(*ar)]; + ie_len = len - sizeof(*ar); + if (ie_len >= 2 + 16 && ie[0] == GSM48_IE_AUTN && ie[1] == 16) + autn = &ie[2]; - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec2(&vec, &auth, ar->rand); + printf("seq %d %s\n", ar->key_seq, autn ? "(UMTS AKA, AUTN present)" : "(GSM AKA)"); - printf("seq %d rand %s", - seq, osmo_hexdump(ar->rand, sizeof(ar->rand))); - printf(" --> sres %s\n", - osmo_hexdump(vec.sres, 4)); + res_len = hnb_test_auth_answer(ar->rand, autn, res, sizeof(res)); + if (res_len < 0) + return res_len; - return hnb_test_tx_dt(hnb, gen_nas_auth_resp(vec.sres)); + return hnb_test_tx_dt(hnb, gen_nas_auth_resp(res, res_len)); } void hnb_test_tx_iu_release_req(struct hnb_test *hnb) @@ -550,6 +625,7 @@ break; case RUA_ProcedureCode_id_Disconnect: printf("RUA rx Disconnect\n"); + hnb_test_rua_disc_handle(hnb, &pdu->choice.successfulOutcome.value); break; case RUA_ProcedureCode_id_ErrorIndication: printf("RUA rx ErrorIndication\n"); @@ -892,7 +968,9 @@ vty->index = chan; vty->node = CHAN_NODE; - if (!chan->is_ps) + if (chan->is_ps) + g_hnb_test.ps.chan = chan; + else g_hnb_test.cs.chan = chan; diff --git a/tests/hnb-test.h b/tests/hnb-test.h index 02efce0..44fba35 100644 --- a/tests/hnb-test.h +++ b/tests/hnb-test.h @@ -72,6 +72,12 @@ struct { struct hnbtest_chan *chan; } cs; + struct { + struct hnbtest_chan *chan; + } ps; + /*! channel the RANAP/NAS message being handled arrived on, set by the + * RUA layer from the CN domain indicator of the DirectTransfer */ + struct hnbtest_chan *cur_chan; }; extern struct hnb_test g_hnb_test; -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/43591?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: Ida588b3ea93c51196fb3a29ed9544dfc4fe4fc30 Gerrit-Change-Number: 43591 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[S] Change in osmo-iuh[master]: hnb-test: count N(SD) over uplink MM messages
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/43593?usp=email ) Change subject: hnb-test: count N(SD) over uplink MM messages ...................................................................... hnb-test: count N(SD) over uplink MM messages Setting N(SD) on the Authentication Response earlier in this series fixed that one message. The TMSI Reallocation Complete that follows the Location Updating Accept still went out with N(SD) = 0, so osmo-msc dropped it as a duplicate as well and released the Location Update with a reject when the TMSI reallocation timer expired. Keep the send sequence number per signalling connection instead of setting it per message. The Location Updating Request in the InitialUE-Message is number 0, and every later uplink MM message, the Identity Response, the Authentication Response and the TMSI Reallocation Complete, takes the next value, two bits wide as on UTRAN (3GPP TS 24.007 section 11.2.3.2.3). This replaces the constant introduced earlier with a counter, so the hard-coded value in gen_nas_auth_resp() goes away. Change-Id: Ieceaee806be43a41e7662e8fa8d119e4e663a3d9 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M tests/hnb-test.c M tests/hnb-test.h 2 files changed, 27 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/93/43593/1 diff --git a/tests/hnb-test.c b/tests/hnb-test.c index be9f170..86ee5a9 100644 --- a/tests/hnb-test.c +++ b/tests/hnb-test.c @@ -191,11 +191,24 @@ return 0; } -static struct msgb *gen_nas_id_resp() +/* Message type octet of an uplink MM message with the send sequence number + * N(SD) in bits 7 and 6 (3GPP TS 24.007 section 11.2.3.2.3). The network + * drops a message whose N(SD) is not the one it expects as a duplicate, + * so every uplink MM message on a connection has to count: the Location + * Updating Request in the InitialUE-Message is number 0. */ +static uint8_t mm_msg_type_nsd(struct hnb_test *hnb, uint8_t msg_type) +{ + struct hnbtest_chan *chan = hnb->cur_chan ? hnb->cur_chan : hnb->cs.chan; + uint8_t n_sd = chan ? chan->n_sd++ : 0; + + return (msg_type & 0x3f) | ((n_sd & 0x03) << 6); +} + +static struct msgb *gen_nas_id_resp(struct hnb_test *hnb) { uint8_t id_resp[] = { GSM48_PDISC_MM, - GSM48_MT_MM_ID_RESP, + mm_msg_type_nsd(hnb, GSM48_MT_MM_ID_RESP), /* IMEISV */ 0x09, /* len */ 0x03, /* first digit (0000) + even (0) + id IMEISV (011) */ @@ -206,11 +219,11 @@ return ranap_new_msg_dt(0, id_resp, sizeof(id_resp)); } -static struct msgb *gen_nas_tmsi_realloc_compl() +static struct msgb *gen_nas_tmsi_realloc_compl(struct hnb_test *hnb) { uint8_t id_resp[] = { GSM48_PDISC_MM, - GSM48_MT_MM_TMSI_REALL_COMPL, + mm_msg_type_nsd(hnb, GSM48_MT_MM_TMSI_REALL_COMPL), }; return ranap_new_msg_dt(0, id_resp, sizeof(id_resp)); @@ -219,10 +232,8 @@ /* MM Authentication Response, 3GPP TS 24.008 section 9.2.3. For GSM AKA * only the four octet SRES is present. For UMTS AKA the first four octets * of RES go into that field and the rest into the Authentication Response - * Parameter (extension) IE, as a UE does. The message type octet carries - * N(SD) = 1: it is the second uplink MM message on the connection, after - * the Location Updating Request (TS 24.007 section 11.2.3.2.3). */ -static struct msgb *gen_nas_auth_resp(const uint8_t *res, unsigned int res_len) + * Parameter (extension) IE, as a UE does. */ +static struct msgb *gen_nas_auth_resp(struct hnb_test *hnb, const uint8_t *res, unsigned int res_len) { uint8_t buf[2 + 4 + 2 + 12]; unsigned int len = 0; @@ -230,7 +241,7 @@ OSMO_ASSERT(res_len >= 4 && res_len <= 16); buf[len++] = GSM48_PDISC_MM; - buf[len++] = 0x40 | GSM48_MT_MM_AUTH_RESP; + buf[len++] = mm_msg_type_nsd(hnb, GSM48_MT_MM_AUTH_RESP); memcpy(buf + len, res, 4); len += 4; if (res_len > 4) { @@ -439,7 +450,7 @@ if (res_len < 0) return res_len; - return hnb_test_tx_dt(hnb, gen_nas_auth_resp(res, res_len)); + return hnb_test_tx_dt(hnb, gen_nas_auth_resp(hnb, res, res_len)); } void hnb_test_tx_iu_release_req(struct hnb_test *hnb) @@ -473,13 +484,13 @@ switch (msg_type) { case GSM48_MT_MM_ID_REQ: - return hnb_test_tx_dt(hnb, gen_nas_id_resp()); + return hnb_test_tx_dt(hnb, gen_nas_id_resp(hnb)); case GSM48_MT_MM_LOC_UPD_ACCEPT: if (hnb_test_nas_rx_lu_accept(gh, len, &sent_tmsi)) return -1; if (sent_tmsi) - return hnb_test_tx_dt(hnb, gen_nas_tmsi_realloc_compl()); + return hnb_test_tx_dt(hnb, gen_nas_tmsi_realloc_compl(hnb)); else return 0; @@ -965,6 +976,7 @@ chan->imsi = talloc_strdup(chan, argv[1]); chan->conn_id = conn_id; conn_id++; + chan->n_sd = 1; /* the Location Updating Request below is number 0 */ msg = gen_initue_lu(chan->is_ps, chan->conn_id, chan->imsi); rua = rua_new_conn(chan->is_ps, chan->conn_id, msg); diff --git a/tests/hnb-test.h b/tests/hnb-test.h index 44fba35..b3a0c11 100644 --- a/tests/hnb-test.h +++ b/tests/hnb-test.h @@ -43,6 +43,9 @@ int is_ps; uint32_t conn_id; char *imsi; + /*! N(SD) of the next uplink MM message on this connection, + * 3GPP TS 24.007 section 11.2.3.2.3 */ + uint8_t n_sd; }; struct hnb_test { -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/43593?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: Ieceaee806be43a41e7662e8fa8d119e4e663a3d9 Gerrit-Change-Number: 43593 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[S] Change in osmo-iuh[master]: hnb-test: decode CO messages as the RAN side
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/43594?usp=email ) Change subject: hnb-test: decode CO messages as the RAN side ...................................................................... hnb-test: decode CO messages as the RAN side hnb-test plays the RNC, but decoded the RANAP carried in a RUA DirectTransfer with ranap_cn_rx_co(), the decoder for messages a CN receives. That table has DirectTransfer, SecurityModeControl and Iu Release, but no RAB Assignment, so the request an SGSN sends after a successful Create PDP Context ended in Received RANAP Procedure RAB Assignment (CO, IM) from RNC. Decode not implemented and no RAB Assignment Response was ever sent. Decode connection oriented messages with ranap_ran_rx_co() instead. Its table in ranap_common_ran.c has the RAB Assignment procedure code along with Common ID, Security Mode Control, Iu Release and Direct Transfer, which is what a CN sends to a RAN. libosmo-ranap has no RAN-side connectionless decoder, so Paging and Reset Acknowledge keep using ranap_cn_rx_cl(). Change-Id: Ibdf7fa518d15ebdb247fa349ee4df7b3888ca455 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M tests/hnb-test-rua.c 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/94/43594/1 diff --git a/tests/hnb-test-rua.c b/tests/hnb-test-rua.c index b84087c..6030555 100644 --- a/tests/hnb-test-rua.c +++ b/tests/hnb-test-rua.c @@ -2,6 +2,7 @@ #include <asn1c/ANY.h> #include <osmocom/core/talloc.h> #include <osmocom/ranap/ranap_common_cn.h> +#include <osmocom/ranap/ranap_common_ran.h> #include <osmocom/rua/rua_ies_defs.h> #include "hnb-test.h" @@ -25,7 +26,14 @@ else hnb->cur_chan = hnb->cs.chan; - rc = ranap_cn_rx_co(hnb_test_rua_dt_handle_ranap, hnb, ies.ranaP_Message.buf, ies.ranaP_Message.size); + /* hnb-test is the RAN side of Iu: decode the connection oriented + * messages the CN sends to an RNC (RAB Assignment, Security Mode + * Command, Common ID, Iu Release Command, Direct Transfer). The + * CN-side decoder used before knows only what a CN receives and + * dropped RAB Assignment as "Decode not implemented". There is no + * RAN-side connectionless decoder in libosmo-ranap, so the + * connectionless path keeps the CN-side one. */ + rc = ranap_ran_rx_co(hnb_test_rua_dt_handle_ranap, hnb, ies.ranaP_Message.buf, ies.ranaP_Message.size); hnb->cur_chan = NULL; -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/43594?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: Ibdf7fa518d15ebdb247fa349ee4df7b3888ca455 Gerrit-Change-Number: 43594 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[S] Change in osmo-iuh[master]: hnbap, rua, sabp: link against libosmo-ranap
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/43589?usp=email ) Change subject: hnbap, rua, sabp: link against libosmo-ranap ...................................................................... hnbap, rua, sabp: link against libosmo-ranap libosmo-hnbap, libosmo-rua and libosmo-sabp call asn1_xer_print() and talloc_asn1_ctx, both defined in iu_helpers.c and shipped in libosmo-ranap, but none of the three declares that dependency. GNU ld leaves such references unresolved in a shared object and lets the executable supply them later, even with -no-undefined, so nothing shows on GNU/Linux. Darwin's ld64 refuses: Undefined symbols for architecture arm64: _asn1_xer_print, _talloc_asn1_ctx while linking libosmo-rua.la, libosmo-hnbap.la and libosmo-sabp.la. Add libosmo-ranap.la to the LIBADD of each library and "Requires: libosmo-ranap" to the three .pc.in files, so both the library itself and a consumer that links only one of them record the dependency. There is no cycle: nm on the built libosmo-ranap shows it defines both symbols and references nothing from hnbap, rua or sabp. On GNU/Linux the only change is an explicit DT_NEEDED entry. Change-Id: Ic936829788536bc1b1973a5ed3082a82cbf90d04 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M libosmo-hnbap.pc.in M libosmo-rua.pc.in M libosmo-sabp.pc.in M src/Makefile.am 4 files changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/89/43589/1 diff --git a/libosmo-hnbap.pc.in b/libosmo-hnbap.pc.in index db05756..49eae7c 100644 --- a/libosmo-hnbap.pc.in +++ b/libosmo-hnbap.pc.in @@ -6,5 +6,6 @@ Name: Osmocom HNBAP protocol library Description: C Utility Library Version: @VERSION@ +Requires: libosmo-ranap Libs: -L${libdir} -losmo-hnbap Cflags: -I${includedir}/ diff --git a/libosmo-rua.pc.in b/libosmo-rua.pc.in index b9bd1d4..893e4b5 100644 --- a/libosmo-rua.pc.in +++ b/libosmo-rua.pc.in @@ -6,5 +6,6 @@ Name: Osmocom RUA protocol library Description: C Utility Library Version: @VERSION@ +Requires: libosmo-ranap Libs: -L${libdir} -losmo-rua Cflags: -I${includedir}/ diff --git a/libosmo-sabp.pc.in b/libosmo-sabp.pc.in index fd0c2d4..7cd6a6d 100644 --- a/libosmo-sabp.pc.in +++ b/libosmo-sabp.pc.in @@ -6,5 +6,6 @@ Name: Osmocom SABP protocol library Description: C Utility Library Version: @VERSION@ +Requires: libosmo-ranap Libs: -L${libdir} -losmo-sabp Cflags: -I${includedir}/ diff --git a/src/Makefile.am b/src/Makefile.am index 343fa53..e8962fa 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -65,10 +65,14 @@ RANAP_LIBVERSION=12:0:5 RUA_LIBVERSION=2:0:2 SABP_LIBVERSION=3:0:2 +# libosmo-hnbap, libosmo-rua and libosmo-sabp use asn1_xer_print and +# talloc_asn1_ctx, both defined in iu_helpers.c of libosmo-ranap, so they +# depend on it. Link it explicitly: GNU ld lets a shared object keep such a +# reference unresolved despite -no-undefined, ld64 on Darwin does not. lib_LTLIBRARIES = libosmo-hnbap.la libosmo-ranap.la libosmo-rua.la libosmo-sabp.la libosmo_hnbap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HNBAP_LIBVERSION) -no-undefined libosmo_hnbap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ - $(ASN1C_LIBS) hnbap/libosmo-asn1-hnbap.la + $(ASN1C_LIBS) hnbap/libosmo-asn1-hnbap.la libosmo-ranap.la libosmo_hnbap_la_SOURCES = hnbap_common.c hnbap_encoder.c hnbap_decoder.c libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) -no-undefined @@ -79,12 +83,12 @@ libosmo_rua_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RUA_LIBVERSION) -no-undefined libosmo_rua_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ - $(ASN1C_LIBS) rua/libosmo-asn1-rua.la + $(ASN1C_LIBS) rua/libosmo-asn1-rua.la libosmo-ranap.la libosmo_rua_la_SOURCES = rua_common.c rua_encoder.c rua_decoder.c rua_msg_factory.c libosmo_sabp_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(SABP_LIBVERSION) -no-undefined libosmo_sabp_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ - $(ASN1C_LIBS) sabp/libosmo-asn1-sabp.la + $(ASN1C_LIBS) sabp/libosmo-asn1-sabp.la libosmo-ranap.la libosmo_sabp_la_SOURCES = sabp_common.c sabp_encoder.c sabp_decoder.c -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/43589?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: Ic936829788536bc1b1973a5ed3082a82cbf90d04 Gerrit-Change-Number: 43589 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[S] Change in osmo-iuh[master]: build: rewrite generated includes without sed -i
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/43588?usp=email ) Change subject: build: rewrite generated includes without sed -i ...................................................................... build: rewrite generated includes without sed -i The gen_*.stamp rules in src/Makefile.am post-process the output of asn1tostruct.py with "sed -i 'script' file...". The -i option is not portable. GNU sed takes an optional suffix attached to the option; BSD sed, on macOS and the other BSDs, takes the next argument as the backup suffix, so it reads the script as a suffix and the first file name as the script. The build stops in src/ before a single object is compiled: sed: 1: "hnbap_encoder.c": unterminated substitute pattern All eight rules are affected, for hnbap, rua, ranap and sabp. Loop over the files instead and write each substitution through a temporary file that then replaces the original. That uses only the portable form of sed and gives the same result with either dialect. Change-Id: I6f803fcfb5dd81f0a0b2998b00622f6a19afc5da Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M src/Makefile.am 1 file changed, 27 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/88/43588/1 diff --git a/src/Makefile.am b/src/Makefile.am index 343fa53..f668c7b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,9 @@ SUBDIRS = hnbap rua ranap sabp # Build {hnbap,rua,ranap}_{encoder,decoder}.c using asn1tostruct +# The generated files get their include lines rewritten below. BSD sed on +# macOS takes the argument after -i as a backup suffix, so "sed -i 'script' +# file" is not portable; write through a temporary file instead. ASN1_ROOT = $(top_srcdir)/asn1 ASN1TOSTRUCT = $(ASN1_ROOT)/utils/asn1tostruct.py BUILT_SOURCES = hnbap_decoder.c hnbap_encoder.c rua_decoder.c rua_encoder.c sabp_encoder.c sabp_decoder.c \ @@ -9,8 +12,12 @@ gen_hnbap.stamp: $(ASN1_ROOT)/hnbap/HNBAP-PDU-Contents.asn $(ASN1TOSTRUCT) $(ASN1TOSTRUCT) -p HNBAP_ -f $< # We also need to replace the include in the newly generated .c files: - sed -i 's,^#include "hnbap_ies_defs.h",#include <osmocom/hnbap/hnbap_ies_defs.h>,' hnbap_encoder.c hnbap_decoder.c - sed -i 's,^#include "hnbap_common.h",#include <osmocom/hnbap/hnbap_common.h>,' hnbap_encoder.c hnbap_decoder.c hnbap_ies_defs.h + for f in hnbap_encoder.c hnbap_decoder.c; do \ + sed 's,^#include "hnbap_ies_defs.h",#include <osmocom/hnbap/hnbap_ies_defs.h>,' $$f > $$f.tmp && mv $$f.tmp $$f || exit 1; \ + done + for f in hnbap_encoder.c hnbap_decoder.c hnbap_ies_defs.h; do \ + sed 's,^#include "hnbap_common.h",#include <osmocom/hnbap/hnbap_common.h>,' $$f > $$f.tmp && mv $$f.tmp $$f || exit 1; \ + done mv hnbap_ies_defs.h $(top_builddir)/include/osmocom/hnbap/ # this is ugly ^. hnbap_ies_defs.h is generated from asn1tostruct.py here, but # it should live in include/osmocom/hnbap/. @@ -21,8 +28,12 @@ gen_rua.stamp: $(ASN1_ROOT)/rua/RUA-PDU-Contents.asn $(ASN1TOSTRUCT) $(ASN1TOSTRUCT) -p RUA_ -f $< # We also need to replace the include in the newly generated .c files: - sed -i 's,^#include "rua_ies_defs.h",#include <osmocom/rua/rua_ies_defs.h>,' rua_encoder.c rua_decoder.c - sed -i 's,^#include "rua_common.h",#include <osmocom/rua/rua_common.h>,' rua_encoder.c rua_decoder.c rua_ies_defs.h + for f in rua_encoder.c rua_decoder.c; do \ + sed 's,^#include "rua_ies_defs.h",#include <osmocom/rua/rua_ies_defs.h>,' $$f > $$f.tmp && mv $$f.tmp $$f || exit 1; \ + done + for f in rua_encoder.c rua_decoder.c rua_ies_defs.h; do \ + sed 's,^#include "rua_common.h",#include <osmocom/rua/rua_common.h>,' $$f > $$f.tmp && mv $$f.tmp $$f || exit 1; \ + done mv rua_ies_defs.h $(top_builddir)/include/osmocom/rua/ # this is ugly ^. rua_ies_defs.h is generated from asn1tostruct.py here, but # it should live in include/osmocom/rua/. @@ -33,8 +44,12 @@ gen_ranap.stamp: $(ASN1_ROOT)/ranap/RANAP-PDU-Contents.asn $(ASN1TOSTRUCT) $(ASN1TOSTRUCT) -p RANAP_ -f $< # We also need to replace the include in the newly generated .c files: - sed -i 's,^#include "ranap_ies_defs.h",#include <osmocom/ranap/ranap_ies_defs.h>,' ranap_encoder.c ranap_decoder.c - sed -i 's,^#include "ranap_common.h",#include <osmocom/ranap/ranap_common.h>,' ranap_encoder.c ranap_decoder.c ranap_ies_defs.h + for f in ranap_encoder.c ranap_decoder.c; do \ + sed 's,^#include "ranap_ies_defs.h",#include <osmocom/ranap/ranap_ies_defs.h>,' $$f > $$f.tmp && mv $$f.tmp $$f || exit 1; \ + done + for f in ranap_encoder.c ranap_decoder.c ranap_ies_defs.h; do \ + sed 's,^#include "ranap_common.h",#include <osmocom/ranap/ranap_common.h>,' $$f > $$f.tmp && mv $$f.tmp $$f || exit 1; \ + done mv ranap_ies_defs.h $(top_builddir)/include/osmocom/ranap/ # this is ugly ^. ranap_ies_defs.h is generated from asn1tostruct.py here, but # it should live in include/osmocom/ranap/. @@ -45,8 +60,12 @@ gen_sabp.stamp: $(ASN1_ROOT)/sabp/SABP-PDU-Contents.asn $(ASN1TOSTRUCT) $(ASN1TOSTRUCT) -p SABP_ -f $< # We also need to replace the include in the newly generated .c files: - sed -i 's,^#include "sabp_ies_defs.h",#include <osmocom/sabp/sabp_ies_defs.h>,' sabp_encoder.c sabp_decoder.c - sed -i 's,^#include "sabp_common.h",#include <osmocom/sabp/sabp_common.h>,' sabp_encoder.c sabp_decoder.c sabp_ies_defs.h + for f in sabp_encoder.c sabp_decoder.c; do \ + sed 's,^#include "sabp_ies_defs.h",#include <osmocom/sabp/sabp_ies_defs.h>,' $$f > $$f.tmp && mv $$f.tmp $$f || exit 1; \ + done + for f in sabp_encoder.c sabp_decoder.c sabp_ies_defs.h; do \ + sed 's,^#include "sabp_common.h",#include <osmocom/sabp/sabp_common.h>,' $$f > $$f.tmp && mv $$f.tmp $$f || exit 1; \ + done mv sabp_ies_defs.h $(top_builddir)/include/osmocom/sabp/ # this is ugly ^. sabp_ies_defs.h is generated from asn1tostruct.py here, but # it should live in include/osmocom/sabp/. -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/43588?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: I6f803fcfb5dd81f0a0b2998b00622f6a19afc5da Gerrit-Change-Number: 43588 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
[XS] Change in osmo-sgsn[master]: sgsn: vty: guard NULL iu.ue_ctx when dumping
by Andrei G 08 Sep '26

08 Sep '26
Andrei G has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/43587?usp=email ) Change subject: sgsn: vty: guard NULL iu.ue_ctx when dumping ...................................................................... sgsn: vty: guard NULL iu.ue_ctx when dumping vty_dump_mmctx() reads mm->iu.ue_ctx->conn_id without checking the pointer whenever mm->ran_type is MM_CTX_T_UTRAN_Iu. iu.ue_ctx is NULL for an attached subscriber whose Iu connection has been released. Both paths that do it leave the MM context in place and only clear the pointer: sgsn_mm_ctx_iu_ranap_release_free() and sgsn_mm_ctx_iu_ranap_free() in mmctx.c both end with "mmctx->iu.ue_ctx = NULL". Both also open with "if (!mmctx->iu.ue_ctx) return", so the rest of the file already treats a live MM context with no ue_ctx as an ordinary state. Releasing the Iu connection on inactivity while the subscriber stays attached is standard behaviour, so this is reachable in normal operation, not only after an error. Any "show mm-context" command then dereferences NULL and takes osmo-sgsn down with it. This was hit during Iu integration testing, after a completed GMM Attach followed by an Iu release. Guard the read. The connection id stays 0 when there is no connection, which is what the Gb branch already does for an unset TLLI. The MM state printed just below comes from iu.mm_state_fsm, which is untouched by the release, so the line still reports PMM-IDLE and no information is lost. Change-Id: I19d380401edcdce18586ed9de26cfe85c925c1f2 Signed-off-by: Andrei Gosman <andrei.gosman(a)gmail.com> --- M src/sgsn/sgsn_vty.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/87/43587/1 diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c index ff14589..3d8a3bd 100644 --- a/src/sgsn/sgsn_vty.c +++ b/src/sgsn/sgsn_vty.c @@ -666,7 +666,11 @@ switch(mm->ran_type) { case MM_CTX_T_UTRAN_Iu: #if BUILD_IU - id = mm->iu.ue_ctx->conn_id; + /* The Iu connection can be released while the MM context stays + * attached, which leaves iu.ue_ctx NULL; there is no connection + * id to show then. The MM state below still reports PMM-IDLE. */ + if (mm->iu.ue_ctx) + id = mm->iu.ue_ctx->conn_id; mm_state_name = osmo_fsm_inst_state_name(mm->iu.mm_state_fsm); #endif break; -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/43587?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I19d380401edcdce18586ed9de26cfe85c925c1f2 Gerrit-Change-Number: 43587 Gerrit-PatchSet: 1 Gerrit-Owner: Andrei G <andrei.gosman(a)gmail.com>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • ...
  • 190
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.