aboutsummaryrefslogtreecommitdiffstats
path: root/packet-sll.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-sll.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-sll.c')
-rw-r--r--packet-sll.c47
1 files changed, 5 insertions, 42 deletions
diff --git a/packet-sll.c b/packet-sll.c
index 2e82af1d62..78bec6f64c 100644
--- a/packet-sll.c
+++ b/packet-sll.c
@@ -1,7 +1,7 @@
/* packet-sll.c
* Routines for disassembly of packets from Linux "cooked mode" captures
*
- * $Id: packet-sll.c,v 1.5 2001/01/09 09:59:28 guy Exp $
+ * $Id: packet-sll.c,v 1.6 2001/01/18 07:44:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -138,11 +138,8 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 hatype, halen;
guint8 *src;
proto_item *ti;
- volatile guint16 length;
- tvbuff_t *volatile next_tvb;
- tvbuff_t *volatile trailer_tvb;
- proto_tree *volatile fh_tree = NULL;
- guint length_before;
+ tvbuff_t *next_tvb;
+ proto_tree *fh_tree = NULL;
CHECK_DISPLAY_AS_DATA(proto_sll, tvb, pinfo, tree);
@@ -201,7 +198,6 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
protocol);
next_tvb = tvb_new_subset(tvb, SLL_HEADER_SIZE, -1, -1);
- trailer_tvb = NULL;
switch (protocol) {
case LINUX_SLL_P_802_2:
@@ -224,41 +220,8 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
} else {
- length_before = tvb_reported_length(tvb);
- length = ethertype(protocol, tvb, SLL_HEADER_SIZE, pinfo, tree,
- fh_tree, hf_sll_etype) + SLL_HEADER_SIZE;
- 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 {
- /*
- * There is no padding.
- */
- trailer_tvb = NULL;
- }
- }
-
- /* If there's some bytes left over, mark them. */
- if (trailer_tvb && tree) {
- guint trailer_length;
-
- trailer_length = tvb_length(trailer_tvb);
- if (trailer_length != 0) {
- proto_tree_add_item(fh_tree, hf_sll_trailer,
- trailer_tvb, 0, trailer_length, FALSE);
- }
+ ethertype(protocol, tvb, SLL_HEADER_SIZE, pinfo, tree,
+ fh_tree, hf_sll_etype, hf_sll_trailer);
}
}