From 3dbfe3bb913477a70091b2440b199dccfe74c197 Mon Sep 17 00:00:00 2001 From: morriss Date: Thu, 13 May 2010 18:28:34 +0000 Subject: As suggested in http://www.wireshark.org/lists/wireshark-dev/200809/msg00075.html (as referenced in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 ) and https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3411 : Write a new convenience routine for finding a conversation and, if it is not found, create it. The frame number and addresses are taken from pinfo (as is the common case). Use this function in a bunch of dissectors. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32790 f5534014-38df-0310-8fa8-9805f1628bb7 --- epan/dissectors/packet-dnp.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'epan/dissectors/packet-dnp.c') diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index 39cb023a1e..d719f37297 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -65,12 +65,12 @@ * * Several command codes were missing, causing the dissector to abort decoding * on valid packets. Those commands have been added. - * - * The semantics of Variation 0 have been cleaned up. Variation 0 is the + * + * The semantics of Variation 0 have been cleaned up. Variation 0 is the * "Default Variation". It is used only in Master -> Slave read commands - * to request the data in whatever variation the Slave is configured to use by - * default. Decoder strings have been added to the Binary Output and - * Analog Output objects (10 and 40) so that group read commands will + * to request the data in whatever variation the Slave is configured to use by + * default. Decoder strings have been added to the Binary Output and + * Analog Output objects (10 and 40) so that group read commands will * decode properly. * * Roy M. Silvernail 01/05/2009 @@ -2523,14 +2523,7 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->fragmented = TRUE; /* Look up the conversation to get the fragment reassembly id */ - conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, - pinfo->ptype, pinfo->srcport, pinfo->destport, 0); - - if (conversation == NULL) { - /* No conversation yet, so make one */ - conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, - pinfo->srcport, pinfo->destport, 0); - } + conversation = find_or_create_conversation(pinfo); conv_data_ptr = (dnp3_conv_t*)conversation_get_proto_data(conversation, proto_dnp3); -- cgit v1.2.3