diff options
author | Vasil Velichckov <vvvelichkov@gmail.com> | 2015-06-19 19:24:53 +0300 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-06-22 06:00:14 +0000 |
commit | eb2dffa56c32330a98fec4269322a9bed058c5bb (patch) | |
tree | 3e973d1bafd28ee5e023cd9d2b1e52743b9bba80 /asn1 | |
parent | e8a238fce27baf85ee9ea795ce1a63b7609d5267 (diff) |
GSM MAP: Fix decoding of IPv6 addresses
From 3GPP 23.003
The GSN Address is composed of the following elements:
1) The Address Type, which is a fixed length code (of 2 bits) identifying the type of address that is used in the
Address field.
2) The Address Length, which is a fixed length code (of 6 bits) identifying the length of the Address field.
3) The Address, which is a variable length field which contains either an IPv4 address or an IPv6 address.
Address Type 0 and Address Length 4 are used when Address is an IPv4 address.
Address Type 1 and Address Length 16 are used when Address is an IPv6 address.
The IP v4 address structure is defined in RFC 791 [14].
The IP v6 address structure is defined in RFC 2373 [15].
Currently the Wireshark decodes IPv6 addresses as IPv4
This commit reverts parts of commit 1cdef1d98aac306932dc599d427a3e1191d48a44
Change-Id: I4905d4cf559abcb42b9dfe3652667d2ff96dd444
Reviewed-on: https://code.wireshark.org/review/8984
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/gsm_map/gsm_map.cnf | 6 | ||||
-rw-r--r-- | asn1/gsm_map/packet-gsm_map-template.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/asn1/gsm_map/gsm_map.cnf b/asn1/gsm_map/gsm_map.cnf index 5d95ebf3b9..745ed7f700 100644 --- a/asn1/gsm_map/gsm_map.cnf +++ b/asn1/gsm_map/gsm_map.cnf @@ -644,10 +644,10 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; octet = tvb_get_guint8(parameter_tvb,0); switch(octet){ case 0x04: /* IPv4 */ - proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv4, parameter_tvb, 1, tvb_reported_length_remaining(parameter_tvb, 1), ENC_BIG_ENDIAN); + proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv4, parameter_tvb, 1, 4, ENC_BIG_ENDIAN); break; - case 0x50: /* IPv4 */ - proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv4, parameter_tvb, 1, tvb_reported_length_remaining(parameter_tvb, 1), ENC_BIG_ENDIAN); + case 0x50: /* IPv6 */ + proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv6, parameter_tvb, 1, 16, ENC_NA); break; default: break; diff --git a/asn1/gsm_map/packet-gsm_map-template.c b/asn1/gsm_map/packet-gsm_map-template.c index b90903d90d..586cd48b83 100644 --- a/asn1/gsm_map/packet-gsm_map-template.c +++ b/asn1/gsm_map/packet-gsm_map-template.c @@ -111,6 +111,7 @@ static int hf_gsm_map_qos_transfer_delay = -1; static int hf_gsm_map_guaranteed_max_brate_ulink = -1; static int hf_gsm_map_guaranteed_max_brate_dlink = -1; static int hf_gsm_map_GSNAddress_IPv4 = -1; +static int hf_gsm_map_GSNAddress_IPv6 = -1; static int hf_gsm_map_ranap_service_Handover = -1; static int hf_gsm_map_IntegrityProtectionInformation = -1; static int hf_gsm_map_EncryptionInformation = -1; @@ -2749,6 +2750,10 @@ void proto_register_gsm_map(void) { { "GSN-Address IPv4", "gsm_map.gsnaddress_ipv4", FT_IPv4, BASE_NONE, NULL, 0, "IPAddress IPv4", HFILL }}, + { &hf_gsm_map_GSNAddress_IPv6, + { "GSN Address IPv6", "gsm_map.gsnaddress_ipv6", + FT_IPv6, BASE_NONE, NULL, 0, + "IPAddress IPv6", HFILL }}, { &hf_gsm_map_ranap_service_Handover, { "service-Handover", "gsm_map.ranap.service_Handover", FT_UINT32, BASE_DEC, VALS(ranap_Service_Handover_vals), 0, |