From 2223025e218263af6e1157ef1eeca1686cefe4b9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 19 Aug 2009 12:53:57 +0200 Subject: [tmsi] Make the tmsi a 4 octet number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tmsi is four octets long, there is no need to make it a string and then jump through hoops to convert it to a number. Keep the database using it as a string to benefit from the NULL handling of the db. Introduce the reserved tmsi which has all bits set to 1 according to GSM 03.03 ยง2.4 and start checking for it and make sure the db code will never allocate such a tmsi. --- openbsc/src/gsm_subscriber_base.c | 1 + 1 file changed, 1 insertion(+) (limited to 'openbsc/src/gsm_subscriber_base.c') diff --git a/openbsc/src/gsm_subscriber_base.c b/openbsc/src/gsm_subscriber_base.c index d6a179b5c..345544d49 100644 --- a/openbsc/src/gsm_subscriber_base.c +++ b/openbsc/src/gsm_subscriber_base.c @@ -112,6 +112,7 @@ struct gsm_subscriber *subscr_alloc(void) memset(s, 0, sizeof(*s)); llist_add_tail(&s->entry, &active_subscribers); s->use_count = 1; + s->tmsi = GSM_RESERVED_TMSI; INIT_LLIST_HEAD(&s->requests); -- cgit v1.2.3