[PATCH] Fix MNC length for Swisscom SIM cards

Andrejs Cainikovs andrejs.cainikovs
Wed Aug 28 08:19:03 PDT 2013


From: Andrejs Cainikovs <andrejs.cainikovs at sonymobile.com>

Swisscom SIM cards does not include MNC length with in 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 is done now for Finland.

Signed-hostap: Andrejs Cainikovs <andrejs.cainikovs at sonymobile.com>
---
 src/eap_peer/eap.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c
index c0d7078..554e7e9 100644
--- a/src/eap_peer/eap.c
+++ b/src/eap_peer/eap.c
@@ -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 */
 
-- 
1.7.9.5




More information about the Hostap mailing list