aboutsummaryrefslogtreecommitdiffstats
path: root/packet-icmpv6.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-10-01 08:29:37 +0000
committerGuy Harris <guy@alum.mit.edu>2001-10-01 08:29:37 +0000
commitd627904aba3732e3badbca8467f88758c2668b25 (patch)
tree469015385bd66c0d924f444094baf9b94145393e /packet-icmpv6.c
parent3869ff8bfb9804ff27c558196efffbd75dc27263 (diff)
Have a flag in the "packet_info" structure, which indicates whether the
stuff currently being dissected is part of a packet included in an error packet (e.g., an ICMP Unreachable packet). Have the TCP dissector not bother doing reassembly if the TCP segment is part of an error packet, rather than an actual TCP transmission; other dissectors might want to treat those packets specially as well. Add to the "tcpinfo" structure a flag indicating whether the URG flag was set, rather than having the zero or non-zero value of the urgent pointer indicate that. (Yes, at least as I read RFC 793, a zero urgent pointer value isn't useful, as it means "the stuff before this segment is urgent", but it's certainly possible to put onto the wire a TCP segment with URG set and a zero urgent pointer.) Don't dissect the TCP header by grabbing the entire header with "tvb_memcpy()" and then pulling stuff out of it - extract stuff with individual tvbuff calls, and put stuff into the protocol tree and the Info column as we extract it, so that we can dissect a partial header. This lets us, for example, get the source and destination ports from the TCP header of the part of a TCP segment included in a minimum-length ICMPv4 error packet. svn path=/trunk/; revision=3986
Diffstat (limited to 'packet-icmpv6.c')
-rw-r--r--packet-icmpv6.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/packet-icmpv6.c b/packet-icmpv6.c
index dc5ee6acc1..23e736705d 100644
--- a/packet-icmpv6.c
+++ b/packet-icmpv6.c
@@ -1,7 +1,7 @@
/* packet-icmpv6.c
* Routines for ICMPv6 packet disassembly
*
- * $Id: packet-icmpv6.c,v 1.52 2001/09/27 10:35:40 guy Exp $
+ * $Id: packet-icmpv6.c,v 1.53 2001/10/01 08:29:34 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -116,6 +116,7 @@ dissect_contained_icmpv6(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
address save_net_dst;
address save_src;
address save_dst;
+ gboolean save_in_error_pkt;
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
@@ -139,10 +140,20 @@ dissect_contained_icmpv6(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
save_src = pinfo->src;
save_dst = pinfo->dst;
+ /* Save the current value of the "we're inside an error packet"
+ flag, and set that flag; subdissectors may treat packets
+ that are the payload of error packets differently from
+ "real" packets. */
+ save_in_error_pkt = pinfo->in_error_pkt;
+ pinfo->in_error_pkt = TRUE;
+
/* Dissect the contained packet.
Catch ReportedBoundsError, and do nothing if we see it,
because it's not an error if the contained packet is short;
- there's no guarantee that all of it was included. */
+ there's no guarantee that all of it was included.
+
+ XXX - should catch BoundsError, and re-throw it after cleaning
+ up. */
TRY {
call_dissector(ipv6_handle, next_tvb, pinfo, tree);
}
@@ -151,6 +162,9 @@ dissect_contained_icmpv6(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
}
ENDTRY;
+ /* Restore the "we're inside an error packet" flag. */
+ pinfo->in_error_pkt = save_in_error_pkt;
+
/* Restore the addresses. */
pinfo->dl_src = save_dl_src;
pinfo->dl_dst = save_dl_dst;