[PATCH] osmocom-bb[master]: vty_interface.c: use RPLMN from settings if preset

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu Jul 27 06:37:42 UTC 2017


Review at  https://gerrit.osmocom.org/3357

vty_interface.c: use RPLMN from settings if preset

Previously, when testcard was attached via VTY interface, the
initial values were used for MCC / MNC, LAC and TMSI, even if
correct RPLMN settings were set.

Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/57/3357/1

diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index d909153..b26d471 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -472,6 +472,9 @@
 	int attached)
 {
 	struct osmocom_ms *ms;
+	struct gsm_settings *set;
+
+	/* Initial testcard settings */
 	uint16_t mcc = 0x001, mnc = 0x01f, lac = 0x0000;
 	uint32_t tmsi = 0xffffffff;
 
@@ -485,6 +488,18 @@
 		return CMD_WARNING;
 	}
 
+	set = &ms->settings;
+	if (set->test_rplmn_valid) {
+		mcc = set->test_rplmn_mcc;
+		mnc = set->test_rplmn_mnc;
+
+		if (set->test_lac > 0x0000 && set->test_lac < 0xfffe)
+			lac = set->test_lac;
+
+		if (set->test_tmsi != 0xffffffff)
+			tmsi = set->test_tmsi;
+	}
+
 	if (argc == 2) {
 		vty_out(vty, "Give MNC together with MCC%s", VTY_NEWLINE);
 		return CMD_WARNING;

-- 
To view, visit https://gerrit.osmocom.org/3357
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list