aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rpcrdma.c
diff options
context:
space:
mode:
authorJorge Mora <jmora1300@gmail.com>2020-11-20 12:15:33 -0700
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2020-11-23 08:07:36 +0000
commit753515f48ff2066e93b11fb2672411df37d96b3e (patch)
tree12781b1c5a4e204e602a8212bb76ba35da539fa4 /epan/dissectors/packet-rpcrdma.c
parent699f1f904197fa1f3a3e2b002771b1bca76f4f08 (diff)
RPCoRDMA: fix RPC-over-RDMA message type info
Get value of message type from the buffer before displaying it in the info column of the packet list pane. Also, make sure there is enough bytes in the buffer to get the RPCoRDMA header.
Diffstat (limited to 'epan/dissectors/packet-rpcrdma.c')
-rw-r--r--epan/dissectors/packet-rpcrdma.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-rpcrdma.c b/epan/dissectors/packet-rpcrdma.c
index 76085c7de6..5b4d7c50a9 100644
--- a/epan/dissectors/packet-rpcrdma.c
+++ b/epan/dissectors/packet-rpcrdma.c
@@ -1325,7 +1325,7 @@ dissect_rpcrdma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
proto_item *ti;
proto_tree *rpcordma_tree;
guint offset;
- guint32 msg_type = 0;
+ guint32 msg_type;
guint32 xid;
guint32 val;
guint write_size;
@@ -1336,13 +1336,14 @@ dissect_rpcrdma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
/* tvb_get_ntohl() should not throw an exception while checking if
this is an rpcrdma packet */
- if (tvb_captured_length(tvb) < 8)
+ if (tvb_captured_length(tvb) < MIN_RPCRDMA_HDR_SZ)
return 0;
if (tvb_get_ntohl(tvb, 4) != 1) /* vers */
return 0;
xid = tvb_get_ntohl(tvb, 0);
+ msg_type = tvb_get_ntohl(tvb, 12);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RPCoRDMA");
col_add_fstr(pinfo->cinfo, COL_INFO, "%s XID 0x%x",
@@ -1362,8 +1363,8 @@ dissect_rpcrdma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
proto_tree_add_item(rpcordma_tree, hf_rpcordma_flow_control, tvb,
offset, 4, ENC_BIG_ENDIAN);
offset += 4;
- proto_tree_add_item_ret_uint(rpcordma_tree, hf_rpcordma_message_type, tvb,
- offset, 4, ENC_BIG_ENDIAN, &msg_type);
+ proto_tree_add_item(rpcordma_tree, hf_rpcordma_message_type, tvb,
+ offset, 4, ENC_BIG_ENDIAN);
offset += 4;
switch (msg_type) {