Bug #6457
openPLMN: 3-digit MNC problem in umts_cell_id
80%
Description
a PLMN of 01-001 is different from 01-01, which is why we have the bool mnc_3_digits in osmo_plmn_id.
struct umts_cell_id in osmo-hnbgw.git however doesn't use osmo_plmn_id, and has no flag like mnc_3_digits.
Instead there seems to be a single, global indicator at g_hnbgw->config.plmn.mnc_3_digits.
Looking at hnbgw_rx_hnb_register_req(), we have the mnc_3_digits flag parsed from HNBAP, and just discard it:
struct osmo_plmn_id plmn; ... osmo_plmn_from_bcd(ies.plmNidentity.buf, &plmn); ctx->id.mcc = plmn.mcc; ctx->id.mnc = plmn.mnc; cell_id_str = umts_cell_id_name(&ctx->id);
In consequence, umts_cell_id_name() and umts_cell_id_from_str() cannot properly convey the 2-digit / 3-digit difference.
The global flag is a dirty hack at best. It's unlikely to bother anyone in reality, but it breaks operating mixed 3-digit-mnc and 2-digit-mnc PLMNs, no matter how it is configured.
It would be trivial to just transport the proper 3-digit flag along everywhere, like we already do in our other CNI implementations.