aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoshiyuki Kurauchi <ahochauwaaaaa@gmail.com>2020-05-16 20:33:51 +0900
committerAnders Broman <a.broman58@gmail.com>2020-05-16 14:17:24 +0000
commita9b0db19c03a923705aa5ff17e9aaaa7139e0108 (patch)
treeeb3966d85ce278ffdc1c8e6db66562663a6764c3
parentcf340fa0ec458e9a0fd97f4e6a6bd427217fd441 (diff)
PFCP: fix Trace Information IE
This commit fixes wrong dissection on the following fields in Trace Information IE. Session Trace Depth: don't overwrite length_trigger_events. List of Interfaces: use length_list_interfaces instead of length_list_trigger_events. IP Address of Trace Collection Entity: * dissect as IPv4 or IPv6 depending on the length. * rename the field with the full name defined in spec. Change-Id: I53537bfd61149fe42417667799c0542b98815882 Signed-off-by: Yoshiyuki Kurauchi <ahochauwaaaaa@gmail.com> Reviewed-on: https://code.wireshark.org/review/37212 Reviewed-by: Joakim Karlsson <oakimk@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-pfcp.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/epan/dissectors/packet-pfcp.c b/epan/dissectors/packet-pfcp.c
index e80eb3a9ec..9a1f5e1a4b 100644
--- a/epan/dissectors/packet-pfcp.c
+++ b/epan/dissectors/packet-pfcp.c
@@ -567,7 +567,8 @@ static int hf_pfcp_trace_information_session_trace_depth = -1;
static int hf_pfcp_trace_information_length_list_interfaces = -1;
static int hf_pfcp_trace_information_list_interfaces = -1;
static int hf_pfcp_trace_information_length_ipaddress = -1;
-static int hf_pfcp_trace_information_ipaddress = -1;
+static int hf_pfcp_trace_information_ipv4 = -1;
+static int hf_pfcp_trace_information_ipv6 = -1;
static int hf_pfcp_frame_route = -1;
static int hf_pfcp_frame_routing = -1;
@@ -5763,7 +5764,7 @@ dissect_pfcp_trace_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
offset += length_trigger_events;
/* m+1 Session Trace Depth */
- proto_tree_add_item_ret_uint(tree, hf_pfcp_trace_information_session_trace_depth, tvb, offset, 1, ENC_BIG_ENDIAN, &length_trigger_events);
+ proto_tree_add_item(tree, hf_pfcp_trace_information_session_trace_depth, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/* m+2 Length of List of Interfaces */
@@ -5771,15 +5772,19 @@ dissect_pfcp_trace_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
offset += 1;
/* (m+3) to p List of Interfaces */
- proto_tree_add_item(tree, hf_pfcp_trace_information_list_interfaces, tvb, offset, length_trigger_events, ENC_NA);
+ proto_tree_add_item(tree, hf_pfcp_trace_information_list_interfaces, tvb, offset, length_list_interfaces, ENC_NA);
offset += length_list_interfaces;
/* p+1 Length of IP address of Trace Collection Entity */
proto_tree_add_item_ret_uint(tree, hf_pfcp_trace_information_length_ipaddress, tvb, offset, 1, ENC_BIG_ENDIAN, &length_ipaddress);
offset += 1;
- /* (p+2) to q IP Address */
- proto_tree_add_item(tree, hf_pfcp_trace_information_ipaddress, tvb, offset, length_ipaddress, ENC_NA);
+ /* (p+2) to q IP Address of Trace Collection Entity */
+ if (length_ipaddress == 4) {
+ proto_tree_add_item(tree, hf_pfcp_trace_information_ipv4, tvb, offset, length_ipaddress, ENC_NA);
+ } else if (length_ipaddress == 16) {
+ proto_tree_add_item(tree, hf_pfcp_trace_information_ipv6, tvb, offset, length_ipaddress, ENC_NA);
+ }
offset += length_ipaddress;
if (offset < length) {
@@ -11211,9 +11216,14 @@ proto_register_pfcp(void)
FT_UINT8, BASE_DEC, NULL, 0,
NULL, HFILL }
},
- { &hf_pfcp_trace_information_ipaddress,
- { "IP Address", "pfcp.trace_information.ipaddress",
- FT_BYTES, BASE_NONE, NULL, 0x0,
+ { &hf_pfcp_trace_information_ipv4,
+ { "IP Address of Trace Collection Entity", "pfcp.trace_information.ipv4",
+ FT_IPv4, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_pfcp_trace_information_ipv6,
+ { "IP Address of Trace Collection Entity", "pfcp.trace_information.ipv6",
+ FT_IPv6, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},