aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Mora <jmora1300@gmail.com>2021-08-25 14:15:39 -0600
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-08-31 08:14:31 +0000
commit981ec7f3c7740c4b41eb072be0408c1df870dc05 (patch)
treee801a54af8bfe7af399b27a0fc28e542d61d5541
parente446bbc3e725fbe4c4ba392065be646a64ae45c5 (diff)
iwarp_mpa: fix iWarp MPA for NFS-over-RDMA
On the first packet of the conversation, the MPA layer is dissected correctly followed by the DDP, RDMAP, RPC-over-RDMA, RPC and NFS layers. The MPA layer sets the TCP conversation as MPA protocol but when it dissects the RPC layer it also sets the TCP conversation as RPC protocol thus overwriting the previous protocol. Added new port type PT_IWARP_MPA so that when the RPC layer is dissected it does not overwrite the default protocol for the TCP conversation which has already been set to MPA. Fixes #15869.
-rw-r--r--epan/address.h3
-rw-r--r--epan/conversation.c2
-rw-r--r--epan/conversation.h3
-rw-r--r--epan/dissectors/packet-exported_pdu.c1
-rw-r--r--epan/dissectors/packet-iwarp-mpa.c3
-rw-r--r--epan/dissectors/packet-rpc.c13
-rw-r--r--epan/exported_pdu.c2
-rw-r--r--epan/to_str.c1
-rw-r--r--wsutil/exported_pdu_tlvs.h2
9 files changed, 24 insertions, 6 deletions
diff --git a/epan/address.h b/epan/address.h
index 993bdb4566..24f8470233 100644
--- a/epan/address.h
+++ b/epan/address.h
@@ -357,7 +357,8 @@ typedef enum {
PT_USB, /* USB endpoint 0xffff means the host */
PT_I2C,
PT_IBQP, /* Infiniband QP number */
- PT_BLUETOOTH
+ PT_BLUETOOTH,
+ PT_IWARP_MPA /* iWarp MPA */
} port_type;
#ifdef __cplusplus
diff --git a/epan/conversation.c b/epan/conversation.c
index 517199c800..e101c795ed 100644
--- a/epan/conversation.c
+++ b/epan/conversation.c
@@ -1641,6 +1641,8 @@ endpoint_type conversation_pt_to_endpoint_type(port_type pt)
return ENDPOINT_IBQP;
case PT_BLUETOOTH:
return ENDPOINT_BLUETOOTH;
+ case PT_IWARP_MPA:
+ return ENDPOINT_IWARP_MPA;
}
DISSECTOR_ASSERT(FALSE);
diff --git a/epan/conversation.h b/epan/conversation.h
index 2c158261cd..c920e09ee1 100644
--- a/epan/conversation.h
+++ b/epan/conversation.h
@@ -79,7 +79,8 @@ typedef enum {
ENDPOINT_BICC, /* BICC Circuit identifier */
ENDPOINT_GSMTAP,
ENDPOINT_IUUP,
- ENDPOINT_DVBBBF /* DVB Base Band Frame ISI/PLP_ID */
+ ENDPOINT_DVBBBF, /* DVB Base Band Frame ISI/PLP_ID */
+ ENDPOINT_IWARP_MPA /* iWarp MPA */
} endpoint_type;
/**
diff --git a/epan/dissectors/packet-exported_pdu.c b/epan/dissectors/packet-exported_pdu.c
index ca08a1a8bb..f978636046 100644
--- a/epan/dissectors/packet-exported_pdu.c
+++ b/epan/dissectors/packet-exported_pdu.c
@@ -118,6 +118,7 @@ static const value_string exported_pdu_port_type_vals[] = {
{ EXP_PDU_PT_IBQP, "IBQP" },
{ EXP_PDU_PT_BLUETOOTH,"BLUETOOTH" },
{ EXP_PDU_PT_TDMOP, "TDMOP" },
+ { EXP_PDU_PT_IWARP_MPA,"IWARP_MPA" },
{ 0, NULL }
};
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c
index ce1a0db6f7..a86cc2073e 100644
--- a/epan/dissectors/packet-iwarp-mpa.c
+++ b/epan/dissectors/packet-iwarp-mpa.c
@@ -920,6 +920,9 @@ dissect_iwarp_mpa_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
return FALSE;
}
+ /* Set the port type for this packet to be iWarp MPA */
+ pinfo->ptype = PT_IWARP_MPA;
+
tcp_dissect_pdus(tvb, pinfo, tree,
TRUE, /* proto_desegment*/
MPA_SMALLEST_FPDU_LEN,
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index 4b406b8707..9155a663ba 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -1677,7 +1677,7 @@ get_conversation_for_call(packet_info *pinfo)
* might send retransmissions from a different port from
* the original request.
*/
- if (pinfo->ptype == PT_TCP || pinfo->ptype == PT_IBQP) {
+ if (pinfo->ptype == PT_TCP || pinfo->ptype == PT_IBQP || pinfo->ptype == PT_IWARP_MPA) {
conversation = find_conversation_pinfo(pinfo, 0);
} else {
/*
@@ -1691,7 +1691,7 @@ get_conversation_for_call(packet_info *pinfo)
}
if (conversation == NULL) {
- if (pinfo->ptype == PT_TCP || pinfo->ptype == PT_IBQP) {
+ if (pinfo->ptype == PT_TCP || pinfo->ptype == PT_IBQP || pinfo->ptype == PT_IWARP_MPA) {
conversation = conversation_new(pinfo->num,
&pinfo->src, &pinfo->dst, conversation_pt_to_endpoint_type(pinfo->ptype),
pinfo->srcport, pinfo->destport, 0);
@@ -1729,7 +1729,7 @@ find_conversation_for_reply(packet_info *pinfo)
* to the original call and a retransmission of the call
* might be sent to different ports.
*/
- if (pinfo->ptype == PT_TCP || pinfo->ptype == PT_IBQP) {
+ if (pinfo->ptype == PT_TCP || pinfo->ptype == PT_IBQP || pinfo->ptype == PT_IWARP_MPA) {
conversation = find_conversation_pinfo(pinfo, 0);
} else {
/*
@@ -1761,6 +1761,11 @@ new_conversation_for_reply(packet_info *pinfo)
&pinfo->src, &pinfo->dst, ENDPOINT_IBQP,
pinfo->srcport, pinfo->destport, 0);
break;
+ case PT_IWARP_MPA:
+ conversation = conversation_new(pinfo->num,
+ &pinfo->src, &pinfo->dst, ENDPOINT_IWARP_MPA,
+ pinfo->srcport, pinfo->destport, 0);
+ break;
default:
conversation = conversation_new(pinfo->num,
&pinfo->dst, &null_address, conversation_pt_to_endpoint_type(pinfo->ptype),
@@ -2147,7 +2152,7 @@ looks_like_rpc_reply(tvbuff_t *tvb, packet_info *pinfo, int offset)
* and this is a connection-oriented transport,
* give up.
*/
- if (((! rpc_find_fragment_start) || (pinfo->ptype != PT_TCP)) && (pinfo->ptype != PT_IBQP)) {
+ if (((! rpc_find_fragment_start) || (pinfo->ptype != PT_TCP)) && (pinfo->ptype != PT_IBQP) && (pinfo->ptype != PT_IWARP_MPA)) {
return NULL;
}
diff --git a/epan/exported_pdu.c b/epan/exported_pdu.c
index 789d165962..0fe97ed31e 100644
--- a/epan/exported_pdu.c
+++ b/epan/exported_pdu.c
@@ -110,6 +110,8 @@ static guint exp_pdu_ws_port_type_to_exp_pdu_port_type(port_type pt)
return EXP_PDU_PT_IBQP;
case PT_BLUETOOTH:
return EXP_PDU_PT_BLUETOOTH;
+ case PT_IWARP_MPA:
+ return EXP_PDU_PT_IWARP_MPA;
}
DISSECTOR_ASSERT(FALSE);
diff --git a/epan/to_str.c b/epan/to_str.c
index 4a8fc1c03d..5ac722223b 100644
--- a/epan/to_str.c
+++ b/epan/to_str.c
@@ -1051,6 +1051,7 @@ port_type_to_str (port_type type)
case PT_I2C: return "I2C";
case PT_IBQP: return "IBQP";
case PT_BLUETOOTH: return "BLUETOOTH";
+ case PT_IWARP_MPA: return "IWARP_MPA";
default: return "[Unknown]";
}
}
diff --git a/wsutil/exported_pdu_tlvs.h b/wsutil/exported_pdu_tlvs.h
index bfd78012d9..bc54996bca 100644
--- a/wsutil/exported_pdu_tlvs.h
+++ b/wsutil/exported_pdu_tlvs.h
@@ -108,6 +108,7 @@
#define EXP_PDU_PT_IBQP 14
#define EXP_PDU_PT_BLUETOOTH 15
#define EXP_PDU_PT_TDMOP 16
+#define EXP_PDU_PT_IWARP_MPA 17
#define EXP_PDU_TAG_PORT_TYPE 24 /**< part type - 4 bytes, EXP_PDU_PT value */
#define EXP_PDU_TAG_SRC_PORT 25 /**< source port - 4 bytes (even for protocols with 2-byte ports) */
@@ -128,6 +129,7 @@
* COL_PROTOCOL might not be filled in.
*/
+
/**< value part is structure passed into TCP subdissectors. The field
begins with a 2-byte version number; if the version number value is
1, the value part is in the form: