aboutsummaryrefslogtreecommitdiffstats
path: root/packet-vlan.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-01-21 22:51:46 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-01-21 22:51:46 +0000
commit15ee7ec7e36a70a762fadfb7c506545f4a69b430 (patch)
treea5ba5f29141aafb5d72821e978779663274ab03c /packet-vlan.c
parentba1b7ba06a1dc3a1db136febfb0a58a217f83b3c (diff)
Remove some more "CHECK_DISPLAY_AS_DATA()" calls and code to set
"pinfo->current_proto", in dissectors always called through dissector tables and handles. Make the IEEE 802.11 dissector static, as it's not called externally. Clear the Info column in the Linux cooked capture and 802.1q VLAN dissectors, before extracting anything from the packet, so that if an exception is thrown, the Info column doesn't reflect the previous protocol. Don't extract the encapsulated protocol in the VLAN dissector until you use it, so that if the frame contains the VLAN ID but not the encapsulated protocol, we at least put the VLAN ID into the protocol tree. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2927 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-vlan.c')
-rw-r--r--packet-vlan.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/packet-vlan.c b/packet-vlan.c
index 595ec8f8e9..a85c1070db 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.30 2001/01/18 07:44:39 guy Exp $
+ * $Id: packet-vlan.c,v 1.31 2001/01/21 22:51:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -83,15 +83,12 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *volatile trailer_tvb;
proto_tree *volatile vlan_tree;
- CHECK_DISPLAY_AS_DATA(proto_vlan, tvb, pinfo, tree);
-
- pinfo->current_proto = "VLAN";
-
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "VLAN");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
tci = tvb_get_ntohs( tvb, 0 );
- encap_proto = tvb_get_ntohs( tvb, 2 );
if (check_col(pinfo->fd, COL_INFO)) {
col_add_fstr(pinfo->fd, COL_INFO, "PRI: %d CFI: %d ID: %d",
@@ -109,6 +106,7 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(vlan_tree, hf_vlan_id, tvb, 0, 2, tci);
}
+ encap_proto = tvb_get_ntohs( tvb, 2 );
if ( encap_proto <= IEEE_802_3_MAX_LEN) {
/* Give the next dissector only 'encap_proto' number of bytes */
proto_tree_add_uint(vlan_tree, hf_vlan_len, tvb, 2, 2, encap_proto);