aboutsummaryrefslogtreecommitdiffstats
path: root/epan/conversation.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-08-01 02:55:13 +0000
committerGuy Harris <guy@alum.mit.edu>2018-08-01 02:55:18 +0000
commit9cf292a30f0098c9abcef57d9242cbc2d00e5075 (patch)
treebfdb6b2b57c51b8a8d904552a70cd010eb43e6d4 /epan/conversation.c
parentb28345b8a46e30986e61d4b837db72bfcd710fcf (diff)
Revert "Have find_or_create_conversation() use pinfo->conv_endpoint if present."
This reverts commit ba202ef36225b59eb797c5a48b8d4a4665b479c7. Creating endpoints, and corresponding conversations, for protocols atop which TCP or UDP runs can potentially cause attempts to look up the conversation to find the conversation for that protocol rather than for TCP/UDP, which can confuse protocols running atop TCP or UDP. Change-Id: I3ca522e54e67cc4f996d0ee841c6bb40ee6a9976 Reviewed-on: https://code.wireshark.org/review/28912 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/conversation.c')
-rw-r--r--epan/conversation.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/epan/conversation.c b/epan/conversation.c
index e1f1a03b85..fc94e3d65b 100644
--- a/epan/conversation.c
+++ b/epan/conversation.c
@@ -765,28 +765,6 @@ conversation_t *conversation_new_by_id(const guint32 setup_frame, const endpoint
return conversation_new(setup_frame, NULL, NULL, etype, id, 0, options | NO_ADDR2 | NO_PORT2);
}
-conversation_t *
-conversation_new_pinfo(packet_info *pinfo)
-{
- if (pinfo->use_endpoint) {
- return conversation_new(pinfo->num,
- &pinfo->conv_endpoint->addr1,
- &pinfo->conv_endpoint->addr2,
- pinfo->conv_endpoint->etype,
- pinfo->conv_endpoint->port1,
- pinfo->conv_endpoint->port2,
- pinfo->conv_endpoint->options);
- } else {
- return conversation_new(pinfo->num,
- &pinfo->src,
- &pinfo->dst,
- conversation_pt_to_endpoint_type(pinfo->ptype),
- pinfo->srcport,
- pinfo->destport,
- 0);
- }
-}
-
/*
* Set the port 2 value in a key. Remove the original from table,
* update the options and port values, insert the updated key.
@@ -1519,7 +1497,29 @@ find_or_create_conversation(packet_info *pinfo)
DPRINT(("did not find previous conversation for frame #%u",
pinfo->num));
DINDENT();
- conv = conversation_new_pinfo(pinfo);
+ conv = conversation_new(pinfo->num, &pinfo->src,
+ &pinfo->dst, conversation_pt_to_endpoint_type(pinfo->ptype),
+ pinfo->srcport, pinfo->destport, 0);
+ DENDENT();
+ }
+
+ DENDENT();
+
+ return conv;
+}
+
+conversation_t *
+find_or_create_conversation_by_id(packet_info *pinfo, const endpoint_type etype, const guint32 id)
+{
+ conversation_t *conv=NULL;
+
+ /* Have we seen this conversation before? */
+ if ((conv = find_conversation_by_id(pinfo->num, etype, id, 0)) == NULL) {
+ /* No, this is a new conversation. */
+ DPRINT(("did not find previous conversation for frame #%u",
+ pinfo->num));
+ DINDENT();
+ conv = conversation_new_by_id(pinfo->num, etype, id, 0);
DENDENT();
}