From 986fe7ed18580775bed91399a1f02eae60bda251 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 13 Sep 2018 03:05:52 +0200 Subject: store classmark in vlr_subscr, not conn Store all Classmark information in the VLR. So, we now always know the Classmark 1 (mandatory IE for LU). This is visible in the msc_vlr_tests -- they no longer indicate "assuming A5/1 is supported" because classmark 1 is missing, because we now know the Classmark 1. Rationale: During Location Updating, we receive Classmark 1; during CM Service Request and Paging Response, we receive Classmark 2. So far we stored these only for the duration of the conn, so as soon as a LU is complete, we would forget CM1. In other words, for anything else than a LU Request, we had no Classmark 1 available at all. During Ciphering Mode Command, we rely on Classmark 1 to determine whether A5/1 is supported. That is moot if we don't even have a Classmark 1 for any CM Service Request or Paging Response initiated connections. The only reason that A5/1 worked is that we assume A5/1 to work if Classmark 1 is missing. To add to the confusion, if a phone indicated that it did *not* support A5/1 in the Classmark 1, according to spec we're supposed to not service it at all. A code comment however says that we instead want to heed the flag -- which so far was only present in a Location Updating initiated connection. Now we can make this decision without assuming things. This got my attention while hacking on sending a BSSMAP Classmark Request from the MSC if it finds missing Classmark information, and was surprised to see it it lacking CM1 to decide about A5/1. Change-Id: I27081bf6e9e017923b2d02607f7ea06beddad82a --- include/osmocom/msc/gsm_data.h | 2 -- include/osmocom/msc/vlr.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 27f7fc591..ffe3afc6b 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -127,8 +127,6 @@ struct gsm_subscriber_connection { /* connected via 2G or 3G? */ enum ran_type via_ran; - struct gsm_classmark classmark; - uint16_t lac; struct gsm_encr encr; diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index 386a548f7..d52713cb2 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -174,6 +174,8 @@ struct vlr_subscr { uint8_t lac; enum ran_type attached_via_ran; } cs; + + struct gsm_classmark classmark; }; enum vlr_ciph { -- cgit v1.2.3