diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-11-05 17:21:23 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-11-06 03:58:03 +0000 |
commit | f894379ea73619d6c31e5c4932d93e307741ffec (patch) | |
tree | 8bcc58b65ebe9efc2ea067639852106e8f34ca06 /epan/dissectors/packet-eap.c | |
parent | 5ba5727ed8f7fa871bf99da20e9650ac9f206c38 (diff) |
E.212: fix identification of PLMNs with 3 digits MNC ending with a 0
Split PLMNs arrays in 2 so as to clearly konw if the MNC is 2 or 3 digits long
Bug: 13092
Change-Id: Ic5f776f3c1e5141f8739bf2137ebd046f7e4a0d6
Reviewed-on: https://code.wireshark.org/review/18679
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-eap.c')
-rw-r--r-- | epan/dissectors/packet-eap.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/epan/dissectors/packet-eap.c b/epan/dissectors/packet-eap.c index 82b2838337..1320c0d753 100644 --- a/epan/dissectors/packet-eap.c +++ b/epan/dissectors/packet-eap.c @@ -50,7 +50,8 @@ static int hf_eap_identity = -1; static int hf_eap_identity_actual_len = -1; static int hf_eap_identity_wlan_prefix = -1; static int hf_eap_identity_wlan_mcc = -1; -static int hf_eap_identity_wlan_mcc_mnc = -1; +static int hf_eap_identity_wlan_mcc_mnc_2digits = -1; +static int hf_eap_identity_wlan_mcc_mnc_3digits = -1; static int hf_eap_notification = -1; @@ -565,6 +566,7 @@ dissect_eap_identity_wlan(tvbuff_t *tvb, packet_info* pinfo, proto_tree* tree, i gchar** tokens = NULL; guint ntokens = 0; gboolean ret = TRUE; + int hf_eap_identity_wlan_mcc_mnc; identity = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, size, ENC_ASCII); @@ -601,8 +603,10 @@ dissect_eap_identity_wlan(tvbuff_t *tvb, packet_info* pinfo, proto_tree* tree, i if (!g_ascii_strncasecmp(tokens[0], tokens[2] + 3, 3)) { mcc_mnc = 1000 * mcc + mnc; + hf_eap_identity_wlan_mcc_mnc = hf_eap_identity_wlan_mcc_mnc_3digits; } else { - mcc_mnc = 1000 * mcc + 10 * mnc; + mcc_mnc = 100 * mcc + mnc; + hf_eap_identity_wlan_mcc_mnc = hf_eap_identity_wlan_mcc_mnc_2digits; } proto_tree_add_uint(eap_identity_tree, hf_eap_identity_wlan_mcc_mnc, @@ -1368,9 +1372,13 @@ proto_register_eap(void) "WLAN Identity Mobile Country Code", "eap.identity.wlan.mcc", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &E212_codes_ext, 0x0, NULL, HFILL }}, - { &hf_eap_identity_wlan_mcc_mnc, { + { &hf_eap_identity_wlan_mcc_mnc_2digits, { "WLAN Identity Mobile Network Code", "eap.identity.wlan.mnc", - FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mcc_mnc_codes_ext, 0x0, NULL, HFILL }}, + FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mcc_mnc_2digits_codes_ext, 0x0, NULL, HFILL }}, + + { &hf_eap_identity_wlan_mcc_mnc_3digits, { + "WLAN Identity Mobile Network Code", "eap.identity.wlan.mnc", + FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mcc_mnc_3digits_codes_ext, 0x0, NULL, HFILL }}, { &hf_eap_identity_actual_len, { "Identity Actual Length", "eap.identity.actual_len", |