forked from osmocom/wireshark
NAS 5GS: fix display of IPv6 interface identifier
Do not use FT_IPV6 as an interface identifier could be wrongly identified as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed as such.
This commit is contained in:
parent
b794e4798a
commit
f64eddfd01
|
@ -24,6 +24,7 @@
|
|||
#include <epan/to_str.h>
|
||||
|
||||
#include <wsutil/pow2.h>
|
||||
#include <wsutil/pint.h>
|
||||
#include <wsutil/wsjson.h>
|
||||
|
||||
#include "packet-gsm_a_common.h"
|
||||
|
@ -4051,9 +4052,7 @@ de_nas_5gs_sm_pdu_address(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
|
|||
proto_item *ti;
|
||||
gboolean si6lla;
|
||||
guint32 pdu_addr;
|
||||
ws_in6_addr interface_id;
|
||||
|
||||
memset(&interface_id, 0, sizeof(interface_id));
|
||||
guint8 interface_id[8];
|
||||
|
||||
/* 0 Spare 0 Spare 0 Spare 0 Spare SI6LLA PDU session type value */
|
||||
proto_tree_add_item_ret_boolean(tree, hf_nas_5gs_sm_si6lla, tvb, offset, 1, ENC_BIG_ENDIAN, &si6lla);
|
||||
|
@ -4071,8 +4070,10 @@ de_nas_5gs_sm_pdu_address(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
|
|||
/* If the PDU session type value indicates IPv6, the PDU address information in octet 4 to octet 11
|
||||
* contains an interface identifier for the IPv6 link local address.
|
||||
*/
|
||||
tvb_memcpy(tvb, (guint8*)&interface_id.bytes[8], offset, 8);
|
||||
proto_tree_add_ipv6(tree, hf_nas_5gs_sm_pdu_addr_inf_ipv6, tvb, offset, 8, &interface_id);
|
||||
tvb_memcpy(tvb, interface_id, offset, 8);
|
||||
proto_tree_add_bytes_format_value(tree, hf_nas_5gs_sm_pdu_addr_inf_ipv6, tvb, offset, 8, NULL,
|
||||
"::%x:%x:%x:%x", pntoh16(&interface_id[0]), pntoh16(&interface_id[2]),
|
||||
pntoh16(&interface_id[4]), pntoh16(&interface_id[6]));
|
||||
offset += 8;
|
||||
break;
|
||||
case 3:
|
||||
|
@ -4080,8 +4081,10 @@ de_nas_5gs_sm_pdu_address(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
|
|||
* contains an interface identifier for the IPv6 link local address and in octet 12 to octet 15
|
||||
* contains an IPv4 address.
|
||||
*/
|
||||
tvb_memcpy(tvb, (guint8*)&interface_id.bytes[8], offset, 8);
|
||||
proto_tree_add_ipv6(tree, hf_nas_5gs_sm_pdu_addr_inf_ipv6, tvb, offset, 8, &interface_id);
|
||||
tvb_memcpy(tvb, interface_id, offset, 8);
|
||||
proto_tree_add_bytes_format_value(tree, hf_nas_5gs_sm_pdu_addr_inf_ipv6, tvb, offset, 8, NULL,
|
||||
"::%x:%x:%x:%x", pntoh16(&interface_id[0]), pntoh16(&interface_id[2]),
|
||||
pntoh16(&interface_id[4]), pntoh16(&interface_id[6]));
|
||||
offset += 8;
|
||||
proto_tree_add_item(tree, hf_nas_5gs_sm_pdu_addr_inf_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
|
||||
offset += 4;
|
||||
|
@ -10180,7 +10183,7 @@ proto_register_nas_5gs(void)
|
|||
},
|
||||
{ &hf_nas_5gs_sm_pdu_addr_inf_ipv6,
|
||||
{ "PDU address information", "nas_5gs.sm.pdu_addr_inf_ipv6",
|
||||
FT_IPv6, BASE_NONE, NULL, 0x0,
|
||||
FT_BYTES, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_nas_5gs_sm_smf_ipv6_lla,
|
||||
|
|
Loading…
Reference in New Issue