From 68cf957bfd8ccee8c82f5328eb7a15aca28cf332 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 18 Sep 2018 15:52:58 +0200 Subject: fix Classmark Update without VLR subscriber This recent patch moves Classmark storage to the VLR subscriber, and introduced a segfault when a Classmark Update is received during IMSI detach: commit 986fe7ed18580775bed91399a1f02eae60bda251 change-id I27081bf6e9e017923b2d02607f7ea06beddad82a Mon Sep 17 01:12:13 2018 +0200 "store classmark in vlr_subscr, not conn" It assumed that we would never accept any Classmark Update messages unless we also have a valid subscriber for it. Well, that is proven wrong by the ttcn3-msc-test TC_imsi_detach_by_imsi(), which brings osmo-msc to its knees. Fix: in case of no valid vlr_subscr being present, store Classmark in the conn temporarily, and copy any received Classmark to VLR subscriber as soon as it gets associated with the conn (if at all). Change-Id: Ib2a2ae6bf86e8f29fc6751a8b5cdb7187cd70290 --- src/libmsc/osmo_msc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libmsc/osmo_msc.c') diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 8efa16ced..3965e9b90 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -147,7 +147,12 @@ void msc_classmark_chg(struct gsm_subscriber_connection *conn, const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len) { - struct gsm_classmark *cm = &conn->vsub->classmark; + struct gsm_classmark *cm; + + if (!conn->vsub) + cm = &conn->temporary_classmark; + else + cm = &conn->vsub->classmark; if (cm2 && cm2_len) { if (cm2_len > sizeof(cm->classmark2)) { -- cgit v1.2.3