diff mbox

Fix MNC length for Swisscom SIM cards

Message ID 1377703143-4630-1-git-send-email-andrejs.cainikovs@gmail.com
State Accepted
Commit fcf20528a029ec382ce8bbcacd37393eae208f0b
Headers show

Commit Message

Andrejs Cainikovs Aug. 28, 2013, 3:19 p.m. UTC
From: Andrejs Cainikovs <andrejs.cainikovs@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@sonymobile.com>
---
 src/eap_peer/eap.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Jouni Malinen Aug. 31, 2013, 7:59 a.m. UTC | #1
On Wed, Aug 28, 2013 at 05:19:03PM +0200, Andrejs Cainikovs wrote:
> 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.

Thanks, applied.
diff mbox

Patch

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 */