This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/23733 ) Change subject: bssap: pass whole tlv_parsed to event GSCON_EV_A_COMMON_ID_IND ...................................................................... bssap: pass whole tlv_parsed to event GSCON_EV_A_COMMON_ID_IND This change will allow handling more IEs in the future, like "Last used E-UTRAN PLMN ID" one. Related: SYS#5337 Change-Id: I96a0e1a7491fabf7aaad62207886821ad6194927 --- M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/osmo_bsc_bssap.c 2 files changed, 11 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve dexter: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 954c6a5..a0c53cb 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -809,7 +809,8 @@ { struct gsm_subscriber_connection *conn = fi->priv; const struct gscon_clear_cmd_data *ccd; - struct osmo_mobile_identity *mi_imsi; + const struct tlv_parsed *tp; + struct osmo_mobile_identity mi_imsi; /* Regular allstate event processing */ switch (event) { @@ -868,14 +869,19 @@ break; case GSCON_EV_A_COMMON_ID_IND: OSMO_ASSERT(data); - mi_imsi = data; + tp = data; + if (osmo_mobile_identity_decode(&mi_imsi, TLVP_VAL(tp, GSM0808_IE_IMSI), TLVP_LEN(tp, GSM0808_IE_IMSI), false) + || mi_imsi.type != GSM_MI_TYPE_IMSI) { + LOGPFSML(fi, LOGL_ERROR, "CommonID: could not parse IMSI\n"); + return; + } if (!conn->bsub) - conn->bsub = bsc_subscr_find_or_create_by_imsi(conn->network->bsc_subscribers, mi_imsi->imsi, + conn->bsub = bsc_subscr_find_or_create_by_imsi(conn->network->bsc_subscribers, mi_imsi.imsi, BSUB_USE_CONN); else { /* we already have a bsc_subscr associated; maybe that subscriber has no IMSI yet? */ if (!conn->bsub->imsi[0]) - bsc_subscr_set_imsi(conn->bsub, mi_imsi->imsi); + bsc_subscr_set_imsi(conn->bsub, mi_imsi.imsi); } gscon_update_id(conn); break; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 9d78153..b558fae 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -1072,7 +1072,6 @@ struct msgb *msg, unsigned int length) { struct tlv_parsed tp; - struct osmo_mobile_identity mi_imsi; osmo_bssap_tlv_parse(&tp, msg->l4h + 1, length - 1); @@ -1084,13 +1083,7 @@ return -EINVAL; } - if (osmo_mobile_identity_decode(&mi_imsi, TLVP_VAL(&tp, GSM0808_IE_IMSI), TLVP_LEN(&tp, GSM0808_IE_IMSI), false) - || mi_imsi.type != GSM_MI_TYPE_IMSI) { - LOGPFSML(conn->fi, LOGL_ERROR, "CommonID: could not parse IMSI\n"); - return -EINVAL; - } - - osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_A_COMMON_ID_IND, &mi_imsi); + osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_A_COMMON_ID_IND, &tp); return 0; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/23733 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I96a0e1a7491fabf7aaad62207886821ad6194927 Gerrit-Change-Number: 23733 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier at sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210415/661c95f6/attachment.htm>