From d91aa1afdf117d0ff15aa3a04f8b39b0283b8633 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 4 Jun 2003 08:43:30 +0000 Subject: If the UDP datagram is included in an error packet, don't dissect the payload if there isn't any. (We do so for real UDP datagrams so that we throw an exception; the exception doesn't cause anything to be displayed if we're dissecting something inside an error packet.) svn path=/trunk/; revision=7779 --- packet-udp.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'packet-udp.c') diff --git a/packet-udp.c b/packet-udp.c index 6398edb371..e94ae781da 100644 --- a/packet-udp.c +++ b/packet-udp.c @@ -1,7 +1,7 @@ /* packet-udp.c * Routines for UDP packet disassembly * - * $Id: packet-udp.c,v 1.107 2003/03/03 23:46:48 sahlberg Exp $ + * $Id: packet-udp.c,v 1.108 2003/06/04 08:43:30 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -241,8 +241,20 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->srcport = udph->uh_sport; pinfo->destport = udph->uh_dport; -/* call sub-dissectors */ - decode_udp_ports( tvb, offset, pinfo, tree, udph->uh_sport, udph->uh_dport); + /* + * Call sub-dissectors. + * + * XXX - should we do this if this is included in an error packet? + * It might be nice to see the details of the packet that caused the + * ICMP error, but it might not be nice to have the dissector update + * state based on it. + * Also, we probably don't want to run UDP taps on those packets. + * + * We definitely don't want to do it for an error packet if there's + * nothing left in the packet. + */ + if (!pinfo->in_error_pkt || tvb_length_remaining(tvb, offset) > 0) + decode_udp_ports(tvb, offset, pinfo, tree, udph->uh_sport, udph->uh_dport); tap_queue_packet(udp_tap, pinfo, udph); } -- cgit v1.2.3