aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x25.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-03-01 08:50:46 +0000
committerGuy Harris <guy@alum.mit.edu>2003-03-01 08:50:46 +0000
commit1f7f3e417888424c53c644a5c877e45e3a0d8a77 (patch)
treeb19ae2e32bfbbd3412f59387f97dfc4f7260f10e /packet-x25.c
parent2af80f530940df1f5ebcf2e4645a648b8dca2780 (diff)
If *all* you have in the user data portion of a Call Request packet is
an NLPID, don't dissect the user data as a packet for that protocol. svn path=/trunk/; revision=7234
Diffstat (limited to 'packet-x25.c')
-rw-r--r--packet-x25.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/packet-x25.c b/packet-x25.c
index 288e88046a..b3a5873758 100644
--- a/packet-x25.c
+++ b/packet-x25.c
@@ -2,7 +2,7 @@
* Routines for X.25 packet disassembly
* Olivier Abad <oabad@noos.fr>
*
- * $Id: packet-x25.c,v 1.78 2003/02/28 00:48:06 guy Exp $
+ * $Id: packet-x25.c,v 1.79 2003/03/01 08:50:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1716,8 +1716,25 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
val_to_str(spi, nlpid_vals, "Unknown (0x%02x)"));
}
+ if (!pinfo->fd->flags.visited) {
+ /*
+ * Is there a dissector handle for this SPI?
+ * If so, assign it to this virtual circuit.
+ */
+ dissect = dissector_get_port_handle(x25_subdissector_table, spi);
+ if (dissect != NULL)
+ x25_hash_add_proto_start(vc, pinfo->fd->num, dissect);
+ }
+
/*
- * If there's more than one octet of user data, we'll
+ * If there's only one octet of user data, it's just
+ * an NLPID; don't try to dissect it.
+ */
+ if (localoffset + 1 <= tvb_reported_length(tvb))
+ return;
+
+ /*
+ * There's more than one octet of user data, so we'll
* dissect it; for some protocols, the NLPID is considered
* to be part of the PDU, so, for those cases, we don't
* skip past it. For other protocols, we skip the NLPID.
@@ -1731,25 +1748,18 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case NLPID_SNDCF:
/*
* The NLPID is part of the PDU. Don't skip it.
+ * But if it's all there is to the PDU, don't
+ * bother dissecting it.
*/
break;
default:
/*
* The NLPID isn't part of the PDU - skip it.
+ * If that means there's nothing to dissect
*/
localoffset++;
}
-
- if (!pinfo->fd->flags.visited) {
- /*
- * Is there a dissector handle for this SPI?
- * If so, assign it to this virtual circuit.
- */
- dissect = dissector_get_port_handle(x25_subdissector_table, spi);
- if (dissect != NULL)
- x25_hash_add_proto_start(vc, pinfo->fd->num, dissect);
- }
}
}
break;