diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-06-04 08:43:30 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-06-04 08:43:30 +0000 |
commit | d91aa1afdf117d0ff15aa3a04f8b39b0283b8633 (patch) | |
tree | 117b6535dded8e2ebf76b20a1ea29a855ef6724f /packet-udp.c | |
parent | c7c20a6724f01cc847a4d400f28e57fefe33d758 (diff) |
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
Diffstat (limited to 'packet-udp.c')
-rw-r--r-- | packet-udp.c | 18 |
1 files changed, 15 insertions, 3 deletions
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 <gerald@ethereal.com> @@ -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); } |