aboutsummaryrefslogtreecommitdiffstats
path: root/epan/conversation.c
diff options
context:
space:
mode:
authorParav Pandit <paravpandit@yahoo.com>2016-11-28 22:40:55 -0500
committerMichael Mann <mmann78@netscape.net>2016-12-03 13:24:16 +0000
commit77f31c6e7de5baed978298ae599494255fe254da (patch)
treee6caf428cf6a40c89f4ac2dc4f5153297bfe1d59 /epan/conversation.c
parent50489fd279637e24b742a1ceaec0282974d07a18 (diff)
packet-infiniband: Fixed duplicate conversation entries
1. Fixed find_conversation for PT_IBQP to not lookup in reverse direction when all searches fail. This is required, because there could be valid different connection in reverse direction which mistakenly gets updated for non template cases. 2. Added support for having MAD data for upper level dissectors to process during RC packet processing. This is required because connection options are negotiated out of band using this CM exchanges (unlike in band TCP options). 3. Moved creating unidirectional connections when actually MAD packets are processed. Previously client-to-server unidirectional conversation was created when CM_RSP stage, where MAD Data of CM_REQ packet is inaccessible. 4. Fixed creating multiple conversations with same address property by eliminating create_conv_and_add_proto_data during RTU stage, which was incorrect. Now they are created during REQ and RSP frame processing. (Instead of RSP and RTU processing). 5. Added support for creating bidirectional connection that ULP can refer. This is required to keep track of oustanding transactions on a connection (requests and responses). Bug: 11363 Change-Id: I32ea084a581a58efbc16dbb7a3e267c82622c50c Tested-by: paravpandit@yahoo.com Reviewed-on: https://code.wireshark.org/review/18982 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/conversation.c')
-rw-r--r--epan/conversation.c83
1 files changed, 45 insertions, 38 deletions
diff --git a/epan/conversation.c b/epan/conversation.c
index e7ee7788df..8da5ff68f1 100644
--- a/epan/conversation.c
+++ b/epan/conversation.c
@@ -1157,51 +1157,58 @@ find_conversation(const guint32 frame_num, const address *addr_a, const address
}
return conversation;
}
-
- /*
- * Well, that didn't find anything.
- * If search address and port B were specified, try looking for a
- * conversation with the specified address B and port B as the
- * first address and port, and with any second address and port
- * (this packet may be going in the opposite direction from the
- * first packet in the conversation).
- * (Neither "addr_a" nor "port_a" take part in this lookup.)
+ /* for Infiniband, don't try to look in addresses of reverse
+ * direction, because it could be another different
+ * valid conversation than what is being searched using
+ * addr_a, port_a.
*/
- DPRINT(("trying dest addr:port as source addr:port and wildcarding dest addr:port"));
- if (addr_a->type == AT_FC)
- conversation =
- conversation_lookup_hashtable(conversation_hashtable_no_addr2_or_port2,
- frame_num, addr_b, addr_a, ptype, port_a, port_b);
- else
- conversation =
- conversation_lookup_hashtable(conversation_hashtable_no_addr2_or_port2,
- frame_num, addr_b, addr_a, ptype, port_b, port_a);
- if (conversation != NULL) {
+ if (ptype != PT_IBQP)
+ {
+
/*
- * If this is for a connection-oriented protocol, set the
- * second address for this conversation to address A, as
- * that's the address that matched the wildcarded second
- * address for this conversation, and set the second port
- * for this conversation to port A, as that's the port
- * that matched the wildcarded second port for this
- * conversation.
+ * Well, that didn't find anything.
+ * If search address and port B were specified, try looking for a
+ * conversation with the specified address B and port B as the
+ * first address and port, and with any second address and port
+ * (this packet may be going in the opposite direction from the
+ * first packet in the conversation).
+ * (Neither "addr_a" nor "port_a" take part in this lookup.)
*/
- DPRINT(("match found"));
- if (ptype != PT_UDP)
- {
- if(!(conversation->options & CONVERSATION_TEMPLATE))
- {
- conversation_set_addr2(conversation, addr_a);
- conversation_set_port2(conversation, port_a);
- }
- else
+ DPRINT(("trying dest addr:port as source addr:port and wildcarding dest addr:port"));
+ if (addr_a->type == AT_FC)
+ conversation =
+ conversation_lookup_hashtable(conversation_hashtable_no_addr2_or_port2,
+ frame_num, addr_b, addr_a, ptype, port_a, port_b);
+ else
+ conversation =
+ conversation_lookup_hashtable(conversation_hashtable_no_addr2_or_port2,
+ frame_num, addr_b, addr_a, ptype, port_b, port_a);
+ if (conversation != NULL) {
+ /*
+ * If this is for a connection-oriented protocol, set the
+ * second address for this conversation to address A, as
+ * that's the address that matched the wildcarded second
+ * address for this conversation, and set the second port
+ * for this conversation to port A, as that's the port
+ * that matched the wildcarded second port for this
+ * conversation.
+ */
+ DPRINT(("match found"));
+ if (ptype != PT_UDP)
{
- conversation = conversation_create_from_template(conversation, addr_a, port_a);
+ if(!(conversation->options & CONVERSATION_TEMPLATE))
+ {
+ conversation_set_addr2(conversation, addr_a);
+ conversation_set_port2(conversation, port_a);
+ }
+ else
+ {
+ conversation = conversation_create_from_template(conversation, addr_a, port_a);
+ }
}
+ return conversation;
}
- return conversation;
}
-
DPRINT(("no matches found"));
/*