aboutsummaryrefslogtreecommitdiffstats
path: root/epan/conversation.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-09-15 20:47:45 +0000
committerEvan Huus <eapache@gmail.com>2013-09-15 20:47:45 +0000
commit5d8143a6abd41ff22633ee029f5d298301d58c3e (patch)
tree1500351a779fda4f5b757145889b6924f7bf5087 /epan/conversation.c
parentdd88e1ab265e096cf56deb1966fc0b86cd2dfd8e (diff)
Our hash function is no longer commutative (yay!). However, this means that we
no longer get to check both conversation directions at once "for free" because the two orderings actually result in different hashes. Do them one at a time. Sorry Anders, this may or may not cancel out some of the performance gain you were looking for. Either way, the new hash function is still an improvement. Fixes bidirectional conversation lookup, which was conveniently showing up as a DTLS decryption failure in the test suite. Go figure. svn path=/trunk/; revision=52084
Diffstat (limited to 'epan/conversation.c')
-rw-r--r--epan/conversation.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/conversation.c b/epan/conversation.c
index 047b7f6df7..4a70470db2 100644
--- a/epan/conversation.c
+++ b/epan/conversation.c
@@ -869,12 +869,18 @@ find_conversation(const guint32 frame_num, const address *addr_a, const address
/*
* Neither search address B nor search port B are wildcarded,
* start out with an exact match.
- * Exact matches check both directions.
*/
conversation =
conversation_lookup_hashtable(conversation_hashtable_exact,
frame_num, addr_a, addr_b, ptype,
port_a, port_b);
+ /* Didn't work, try the other direction */
+ if (conversation == NULL) {
+ conversation =
+ conversation_lookup_hashtable(conversation_hashtable_exact,
+ frame_num, addr_b, addr_a, ptype,
+ port_b, port_a);
+ }
if ((conversation == NULL) && (addr_a->type == AT_FC)) {
/* In Fibre channel, OXID & RXID are never swapped as
* TCP/UDP ports are in TCP/IP.