From: Andrejs Cainikovs Date: Sat, 31 Aug 2013 07:58:23 +0000 (+0300) Subject: Fix MNC length for Swisscom SIM cards X-Git-Tag: aosp-kk-from-upstream~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcf20528a029ec382ce8bbcacd37393eae208f0b;p=thirdparty%2Fhostap.git Fix MNC length for Swisscom SIM cards 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 --- diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c index c0d707861..554e7e94e 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 */