dissectors: epon: Improve preamble detection

The full EPON preamble is 55 55 D5 55, sometimes some bits are getting
lost so this dissector supports multiple parts of this preamble. Add
also the full preamble to detect also such packets correctly.

Change-Id: I6d74694601bf2a430e24f8c9c004f3558aa056c5
Reviewed-on: https://code.wireshark.org/review/26240
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Hauke Mehrtens 2018-03-03 14:00:35 +01:00 committed by Anders Broman
parent 0fcfc634dd
commit c37eeafe81
1 changed files with 5 additions and 3 deletions

View File

@ -69,12 +69,14 @@ dissect_epon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint dpoe_sec_byte;
gboolean dpoe_encrypted = FALSE;
/* Start_of_Packet delimiter (/S/) can either happen in byte 1 or byte 2,
* making the captured preamble either 7 or 6 bytes in length. If the
/* Start_of_Packet delimiter (/S/) can happen in byte 1, 2 or 3,
* making the captured preamble 8, 7 or 6 bytes in length. If the
* preamble starts with 0x55, then /S/ happened in byte 1, making the
* captured preamble 7 bytes in length.
*/
if (tvb_get_ntoh24(tvb, 0) == 0x55D555) {
if (tvb_get_ntohl(tvb, 0) == 0x5555D555) {
offset += 2;
} else if (tvb_get_ntoh24(tvb, 0) == 0x55D555) {
offset += 1;
} else if (tvb_get_ntohs(tvb, 0) == 0xD555) {
offset += 0;