Browse Source

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 <andrejs.cainikovs@sonymobile.com>
Andrejs Cainikovs 11 years ago
parent
commit
fcf20528a0
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/eap_peer/eap.c

+ 2 - 0
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 */