aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Mora <jmora1300@gmail.com>2022-03-17 10:44:40 -0600
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-03-18 21:22:11 +0000
commit4a80186e2b8aa8859605e9462f79ffc16c3d1521 (patch)
tree30887c82683e442bf3292129f5cb39ee3b282052
parent37a0054551fafffcac5435c3f683b45176388cd4 (diff)
RPCoRDMA: do not reassemble if there is only one fragment
Only reassemble if reply chunk size is non-zero to avoid reassembly of a single fragment. The RPC-over-RDMA reply has no data when the reply chunk size is non-zero but it needs to reassemble all fragments (more_frags = FALSE) in this frame. On the other hand when the reply chunk size is zero, the whole message is given in this frame therefore there is no need to reassemble.
-rw-r--r--epan/dissectors/packet-rpcrdma.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/epan/dissectors/packet-rpcrdma.c b/epan/dissectors/packet-rpcrdma.c
index 3f1bd628c8..cf1cbcca9f 100644
--- a/epan/dissectors/packet-rpcrdma.c
+++ b/epan/dissectors/packet-rpcrdma.c
@@ -1245,22 +1245,22 @@ process_rdma_list(tvbuff_t *tvb, guint offset, wmem_array_t *p_list,
if (fd_head == NULL) {
if (p_segment_info == NULL) {
return NULL;
- } else if (p_rdma_chunk->type == RDMA_REPLY_CHUNK && !setup && !pinfo->fd->visited) {
- /*
- * The RPC reply has no data when having a reply chunk but it needs
- * to reassemble all fragments (more_frags = FALSE) in this frame
- */
+ } else if (p_rdma_chunk->type == RDMA_REPLY_CHUNK && !setup &&
+ !pinfo->fd->visited && p_rdma_chunk->length > 0) {
+ /* Only reassemble if reply chunk size is non-zero to avoid
+ * reassembly of a single fragment. The RPC-over-RDMA reply
+ * has no data when the reply chunk size is non-zero but it
+ * needs to reassemble all fragments (more_frags = FALSE)
+ * in this frame. On the other hand when the reply chunk
+ * size is zero, the whole message is given in this frame
+ * therefore there is no need to reassemble. */
new_tvb = add_fragment(tvb, offset, p_segment_info->msgid, 0, FALSE, p_rdma_conv_info, pinfo, tree);
- } else if (p_rdma_chunk->type == RDMA_READ_CHUNK) {
- if (tvb_captured_length_remaining(tvb, offset) > 0) {
- /* Add data after the last read chunk */
- add_fragment(tvb, offset, p_segment_info->msgid, msg_num, TRUE, p_rdma_conv_info, pinfo, tree);
- }
- } else if (p_offset) {
+ } else if (p_rdma_chunk->type == RDMA_READ_CHUNK && tvb_captured_length_remaining(tvb, offset) > 0) {
+ /* Add data after the last read chunk */
+ add_fragment(tvb, offset, p_segment_info->msgid, msg_num, TRUE, p_rdma_conv_info, pinfo, tree);
+ } else if (p_offset && tvb_reported_length_remaining(tvb, offset) > 0) {
/* Add data after the last write chunk */
- if (tvb_reported_length_remaining(tvb, offset) > 0) {
- new_tvb = add_fragment(tvb, offset, p_segment_info->msgid, msg_num, TRUE, p_rdma_conv_info, pinfo, tree);
- }
+ new_tvb = add_fragment(tvb, offset, p_segment_info->msgid, msg_num, TRUE, p_rdma_conv_info, pinfo, tree);
}
}
}