]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix MNC length for Swisscom SIM cards
authorAndrejs Cainikovs <andrejs.cainikovs@sonymobile.com>
Sat, 31 Aug 2013 07:58:23 +0000 (10:58 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 31 Aug 2013 07:58:23 +0000 (10:58 +0300)
Swisscom SIM cards do not include MNC length within EF_AD, and end up
using incorrect MNC length based on the 3-digit default. Hardcode MNC
length of 2 for Switzerland, in the same manner as it was done for
Finland.

Signed-hostap: Andrejs Cainikovs <andrejs.cainikovs@sonymobile.com>

src/eap_peer/eap.c

index c0d707861f68b2b1b64d63a985c999e8980c3e1e..554e7e94e6b2204b8b9fc68b9c0b5bc9ecae9056 100644 (file)
@@ -938,6 +938,8 @@ static int mnc_len_from_imsi(const char *imsi)
        mcc_str[3] = '\0';
        mcc = atoi(mcc_str);
 
+       if (mcc == 228)
+               return 2; /* Networks in Switzerland use 2-digit MNC */
        if (mcc == 244)
                return 2; /* Networks in Finland use 2-digit MNC */