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.
This commit is contained in:
Jorge Mora 2021-08-25 14:15:39 -06:00 committed by Wireshark GitLab Utility
parent e446bbc3e7
commit 981ec7f3c7
9 changed files with 24 additions and 6 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;
/**

View File

@ -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 }
};

View File

@ -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,

View File

@ -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;
}

View File

@ -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);

View File

@ -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]";
}
}

View File

@ -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: