Wireshark-bugs: [Wireshark-bugs] [Bug 7337] New: EtherCAT dissector: datagram header interprets
Date: Wed, 6 Jun 2012 05:04:42 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7337

           Summary: EtherCAT dissector: datagram header interprets some
                    bits wrong
           Product: Wireshark
           Version: 1.6.7
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Major
          Priority: Low
         Component: Wireshark
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created attachment 8562
  --> https://bugs.wireshark.org/bugzilla/attachment.cgi?id=8562
capture of two ethercat packets with bug in order of circulating-bit and second
reserved-bit

Build Information:
wireshark 1.6.7

Copyright 1998-2012 Gerald Combs <[email protected]> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (64-bit) with GTK+ 2.24.10, with GLib 2.32.0, with libpcap (version
unknown), with libz 1.2.3.4, with POSIX capabilities (Linux), without libpcre,
with SMI 0.4.8, with c-ares 1.7.5, with Lua 5.1, without Python, with GnuTLS
2.12.14, with Gcrypt 1.5.0, with MIT Kerberos, with GeoIP, with PortAudio
V19-devel (built Dec 10 2011 11:43:10), without AirPcap.

Running on Linux 3.2.0-24-generic, with libpcap version 1.1.1, with libz
1.2.3.4, GnuTLS 2.12.14, Gcrypt 1.5.0.

Built using gcc 4.6.3.
--
According to the EtherCAT standard, the order of the fields in the datagram
header is defined in this way:

8bit  CMD
8bit  Index
32bit Address
11bit Length
2bit  Reserved
1bit  Circulating frame
1bit  Reserved
1bit  More frames following
16bit IRQ

The dissector interprets the order of the "circulating frame"-bit and the
second "reserved"-bit wrong:

EtherCAT datagram(s): 'LRW': Len: 100, Adp 0x0, Ado 0x1, Wc 2
    EtherCAT datagram: Cmd: 'LRW' (12), Len: 100, Addr 0x10000, Cnt 2
        Header
            Command    : Logical memory read write (0x0c)
            Index      : 0x39
            Log Addr   : 0x00010000
            Length     : 100 (0x64) - No Roundtrip - Last Sub Command
                .... .000 0110 0100 = Length: 100
                ..00 0... .... .... = Reserved: Valid (0)
                .0.. .... .... .... = Round trip: Frame is not circulating (0)
                0... .... .... .... = Last indicator: Last EtherCAT datagram
(0)
            Interrupt  : 0x0000
        Data      : 000000000000000000000000000000000000000000000000...
        Working Cnt: 2

(from http://wiki.wireshark.org/Protocols/ethercat, or see attachment from my
own capture )

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.