aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ethertype.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2020-05-08 18:20:03 -0700
committerGuy Harris <gharris@sonic.net>2020-05-09 03:14:50 +0000
commit7e7db3e91ce50f1f3ba35f88aff83c66b5f9bf97 (patch)
treeddeaf077db64366f56d97c3579ee8ed451a7e3c1 /epan/dissectors/packet-ethertype.c
parent2480d9b69a9f416a6a3836def1479c66fec8d7b9 (diff)
sll: add support for LINKTYPE_LINUX_SLL2.
Different header, with a different size, an additional field, and with fields being in a different order. Distinguish between V1 and V2 by giving the version. That means we can no longer use the "ethertype" dissector as it stands, because the packet type field isn't at the end of the header, right before the payload; pull the "add the type field to the protocol tree" functionality out of the "ethertype" dissector and leave it up to the dissector calling it. Change-Id: I72b8a2483c0a539919fbe5d35fd7e60bff4bf75a Reviewed-on: https://code.wireshark.org/review/37169 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'epan/dissectors/packet-ethertype.c')
-rw-r--r--epan/dissectors/packet-ethertype.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c
index bd2c4f4f21..ee7ab9a60c 100644
--- a/epan/dissectors/packet-ethertype.c
+++ b/epan/dissectors/packet-ethertype.c
@@ -224,15 +224,11 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
return 0;
ethertype_data = (ethertype_data_t*)data;
- /* Add the Ethernet type to the protocol tree */
- proto_tree_add_uint(ethertype_data->fh_tree, ethertype_data->etype_id, tvb,
- ethertype_data->offset_after_ethertype - 2, 2, ethertype_data->etype);
-
/* Get the captured length and reported length of the data
after the Ethernet type. */
- captured_length = tvb_captured_length_remaining(tvb, ethertype_data->offset_after_ethertype);
+ captured_length = tvb_captured_length_remaining(tvb, ethertype_data->payload_offset);
reported_length = tvb_reported_length_remaining(tvb,
- ethertype_data->offset_after_ethertype);
+ ethertype_data->payload_offset);
/* Remember how much data there is after the Ethernet type,
including any trailer and FCS. */
@@ -251,7 +247,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
captured_length = reported_length;
}
}
- next_tvb = tvb_new_subset_length_caplen(tvb, ethertype_data->offset_after_ethertype, captured_length,
+ next_tvb = tvb_new_subset_length_caplen(tvb, ethertype_data->payload_offset, captured_length,
reported_length);
p_add_proto_data(pinfo->pool, pinfo, proto_ethertype, pinfo->curr_layer_num, GUINT_TO_POINTER((guint)ethertype_data->etype));
@@ -297,7 +293,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
}
}
- add_dix_trailer(pinfo, tree, ethertype_data->fh_tree, ethertype_data->trailer_id, tvb, next_tvb, ethertype_data->offset_after_ethertype,
+ add_dix_trailer(pinfo, tree, ethertype_data->fh_tree, ethertype_data->trailer_id, tvb, next_tvb, ethertype_data->payload_offset,
length_before, ethertype_data->fcs_len);
return tvb_captured_length(tvb);