aboutsummaryrefslogtreecommitdiffstats
path: root/packet-vlan.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-01-18 07:44:41 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-01-18 07:44:41 +0000
commitb71d045e173c0e78da2fa319685d3c741b702b03 (patch)
tree479f963eaed0ad216b7059a8ce374cb81805e8b8 /packet-vlan.c
parent50d5503eaf26bd165ebbc36316bb12a3a099f749 (diff)
Pull the handling of trailers in Ethernet (as opposed to 802.3) frames
into "ethertype()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2915 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-vlan.c')
-rw-r--r--packet-vlan.c47
1 files changed, 14 insertions, 33 deletions
diff --git a/packet-vlan.c b/packet-vlan.c
index 173f14bfd4..595ec8f8e9 100644
--- a/packet-vlan.c
+++ b/packet-vlan.c
@@ -1,7 +1,7 @@
/* packet-vlan.c
* Routines for VLAN 802.1Q ethernet header disassembly
*
- * $Id: packet-vlan.c,v 1.29 2001/01/09 09:59:28 guy Exp $
+ * $Id: packet-vlan.c,v 1.30 2001/01/18 07:44:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -82,7 +82,6 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *volatile next_tvb;
tvbuff_t *volatile trailer_tvb;
proto_tree *volatile vlan_tree;
- guint length_before, length;
CHECK_DISPLAY_AS_DATA(proto_vlan, tvb, pinfo, tree);
@@ -164,40 +163,22 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
call_dissector(ipx_handle, next_tvb, pinfo, tree);
}
- } else {
- length_before = tvb_reported_length(tvb);
- length = ethertype(encap_proto, tvb, 4, pinfo, tree, vlan_tree,
- hf_vlan_etype) + 4;
- if (length < length_before) {
- /*
- * Create a tvbuff for the padding.
- */
- TRY {
- trailer_tvb = tvb_new_subset(tvb, length, -1, -1);
- }
- CATCH2(BoundsError, ReportedBoundsError) {
- /* The packet doesn't have "length" bytes worth of captured
- data left in it. No trailer to display. */
- trailer_tvb = NULL;
- }
- ENDTRY;
- } else {
- /* No padding. */
- trailer_tvb = NULL;
- }
- }
- /* If there's some bytes left over, mark them. */
- if (trailer_tvb && tree) {
- int trailer_length;
- const guint8 *ptr;
+ /* If there's some bytes left over, mark them. */
+ if (trailer_tvb && tree) {
+ int trailer_length;
+ const guint8 *ptr;
- trailer_length = tvb_length(trailer_tvb);
- if (trailer_length > 0) {
- ptr = tvb_get_ptr(trailer_tvb, 0, trailer_length);
- proto_tree_add_bytes(vlan_tree, hf_vlan_trailer, trailer_tvb, 0,
- trailer_length, ptr);
+ trailer_length = tvb_length(trailer_tvb);
+ if (trailer_length > 0) {
+ ptr = tvb_get_ptr(trailer_tvb, 0, trailer_length);
+ proto_tree_add_bytes(vlan_tree, hf_vlan_trailer, trailer_tvb, 0,
+ trailer_length, ptr);
+ }
}
+ } else {
+ ethertype(encap_proto, tvb, 4, pinfo, tree, vlan_tree,
+ hf_vlan_etype, hf_vlan_trailer);
}
}