ESL timestamp provided by ET2000 not displayed
Summary
The timestamp of the packet provided by the sniffer ET2000 (nanosecond resolution) are not displayed when the ESL protocol and the esl_eth protocol are enabled.
Steps to reproduce
- Capture packets with an ET2000 ( ethercat sniffer that store the ESL information at the bottom of the packet including the timestamp in nanosecond).
- Enable the "ESL" protocol (Ethercat Switch link) and "esl_eth" (Ethercat over Ethernet)
What is the current bug behavior?
The timestamp displayed of the packet remain unchanged.
What is the expected correct behavior?
The timestamp of the packed should be updated by the ESL timestamp. As reported in Frame 1 e Frame 2 below, the time difference (provided by esl) should be : 0x00000170710d7db0 - 0x00000170710d7888 = 528 (hex) = 1320 nS
Sample capture file
Frame 1: 76 bytes on wire (608 bits), 76 bytes captured (608 bits) on interface eno2, id 0 Interface id: 0 (eno2) Encapsulation type: Ethernet (1) Arrival Time: Sep 2, 2022 08:37:17.730113871 CEST [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1662100637.730113871 seconds [Time delta from previous captured frame: 0.000000000 seconds] [Time delta from previous displayed frame: 0.000000000 seconds] [Time since reference or first frame: 0.000000000 seconds] Frame Number: 1 Frame Length: 76 bytes (608 bits) Capture Length: 76 bytes (608 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:esl:eth:ethertype:ecatf:ecat] [Coloring Rule Name: Broadcast] [Coloring Rule String: eth[0] & 1] Ethernet II, Src: i-mateDe_10:1e:1c (00:25:e9:10:1e:1c), Dst: Broadcast (ff:ff:ff:ff:ff:ff) EtherCAT frame header EtherCAT datagram(s): 'NOP': Len: 0, Adp 0x0, Ado 0x0, Wc 0 Pad bytes: 0000000000000000000000000000000000000000000000000000000000000000 EtherCAT Switch Link Port: 0 .... 0... .... .... = Alignment Error: no ...0 .... .... .... = Crc Error: no timestamp: 0x00000170710d7888 0000 ff ff ff ff ff ff 00 25 e9 10 1e 1c 88 a4 0c 10 0010 00 df 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0030 00 00 00 00 00 00 00 00 00 00 00 00 01 01 05 10 0040 00 00 80 00 88 78 0d 71 70 01 00 00 Frame 2: 76 bytes on wire (608 bits), 76 bytes captured (608 bits) on interface eno2, id 0 Interface id: 0 (eno2) Encapsulation type: Ethernet (1) Arrival Time: Sep 2, 2022 08:37:17.730113912 CEST [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1662100637.730113912 seconds [Time delta from previous captured frame: 0.000000041 seconds] [Time delta from previous displayed frame: 0.000000041 seconds] [Time since reference or first frame: 0.000000041 seconds] Frame Number: 2 Frame Length: 76 bytes (608 bits) Capture Length: 76 bytes (608 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:esl:eth:ethertype:ecatf:ecat] [Coloring Rule Name: Broadcast] [Coloring Rule String: eth[0] & 1] Ethernet II, Src: MS-NLB-PhysServer-32_05:e9:10:1e:1c (02:25:e9:10:1e:1c), Dst: Broadcast (ff:ff:ff:ff:ff:ff) EtherCAT frame header EtherCAT datagram(s): 'NOP': Len: 0, Adp 0x0, Ado 0x0, Wc 0 Pad bytes: 0000000000000000000000000000000000000000000000000000000000000000 EtherCAT Switch Link Port: 1 .... 0... .... .... = Alignment Error: no ...0 .... .... .... = Crc Error: no timestamp: 0x00000170710d7db0 0000 ff ff ff ff ff ff 02 25 e9 10 1e 1c 88 a4 0c 10 0010 00 df 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0030 00 00 00 00 00 00 00 00 00 00 00 00 01 01 05 10 0040 00 00 40 00 b0 7d 0d 71 70 01 00 00
Relevant logs and/or screenshots
Build information
mkdir build cd build cmake .. make -j16 make install
About
3.6.7 (Git commit 4a304d7ec222) Compiled (64-bit) using GCC 8.3.0, with Qt 5.11.3, with libpcap, with POSIX capabilities (Linux), with libnl 3, with GLib 2.58.3, with zlib 1.2.11, with Lua 5.2.4, with GnuTLS 3.6.7 and PKCS #11 support, with Gcrypt 1.8.4, with MIT Kerberos, with MaxMind DB resolver, with nghttp2 1.36.0, without brotli, with LZ4, without Zstandard, with Snappy, with libxml2 2.9.4, with libsmi 0.4.8, with QtMultimedia, without automatic updates, with SpeexDSP (using bundled resampler), without Minizip. Running on Linux 5.14.0-0.bpo.2-amd64, with Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (with SSE4.2), with 31824 MB of physical memory, with GLib 2.58.3, with zlib 1.2.11, with Qt 5.11.3, with libpcap 1.8.1, with c-ares 1.14.0, with GnuTLS 3.6.7, with Gcrypt 1.8.4, with nghttp2 1.36.0, with LZ4 1.8.3, with libsmi 0.4.8, with light display mode, without HiDPI, with LC_TYPE=en_US.utf8, binary plugins supported (18 loaded).
PATCH:
Actually I resolved the issue by appling the following pathc: diff -ruN wireshark-3.6.7.orig/plugins/epan/ethercat/packet-esl.c wireshark-3.6.7.new/plugins/epan/ethercat/packet-esl.c --- wireshark-3.6.7.orig/plugins/epan/ethercat/packet-esl.c 2022-07-27 20:40:30.000000000 +0200 +++ wireshark-3.6.7.new/plugins/epan/ethercat/packet-esl.c 2022-09-02 09:08:27.343606811 +0200 @@ -238,6 +238,7 @@ nstime_delta(&ts_delta, &ts, &pinfo->abs_ts); pinfo->abs_ts = ts; + pinfo->fd->abs_ts = ts; nstime_add(&pinfo->rel_ts, &ts_delta); } }
Edited by Christian Gabrielli