aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ppp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-11-28 22:18:53 +0000
committerGuy Harris <guy@alum.mit.edu>2002-11-28 22:18:53 +0000
commit85fd3afd2f040b8df6af52fef0c9f92801ed4b41 (patch)
treeebf69e77998a48ab2856fd6ebaff38e446693784 /packet-ppp.c
parentb16fb8f257cd0b36ffa23b7e8be25f3a1cd5e966 (diff)
Before dissecting the payload of a Protocol-Reject LCP packet, save the
current "this is an error packet" flag and set that flag, so the payload is dissected as the payload of an error packet rather than as a "real" packet. svn path=/trunk/; revision=6701
Diffstat (limited to 'packet-ppp.c')
-rw-r--r--packet-ppp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/packet-ppp.c b/packet-ppp.c
index 50972b95d1..76276b2d90 100644
--- a/packet-ppp.c
+++ b/packet-ppp.c
@@ -1,7 +1,7 @@
/* packet-ppp.c
* Routines for ppp packet disassembly
*
- * $Id: packet-ppp.c,v 1.101 2002/11/28 20:46:09 guy Exp $
+ * $Id: packet-ppp.c,v 1.102 2002/11/28 22:18:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2366,6 +2366,7 @@ dissect_cp( tvbuff_t *tvb, int proto_id, int proto_subtree_index,
volatile address save_net_dst;
volatile address save_src;
volatile address save_dst;
+ gboolean save_in_error_pkt;
tvbuff_t *next_tvb;
protocol = tvb_get_ntohs(tvb, offset);
@@ -2398,6 +2399,13 @@ dissect_cp( tvbuff_t *tvb, int proto_id, int proto_subtree_index,
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;
@@ -2417,6 +2425,9 @@ dissect_cp( tvbuff_t *tvb, int proto_id, int proto_subtree_index,
}
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;