libmodbus
libmodbus copied to clipboard
Modbus TCP Protocol identifier should be 0
https://github.com/stephane/libmodbus/blob/f1eb4bc7ccb09cd8d19ab641ee37637f8c34d16d/src/modbus-tcp.c#L202
shouldn't there be an || instead of an &&?
I think it should be || indeed. According to a documentation: "Protocol Identifier (2 bytes): This field is always 0 for Modbus services and other values are reserved for future extensions.". That means that both should be at zero. And the code as it is now accepts the packet if at least one byte is zero.
should this go in quirks to allow other protocols?
The gate to quirks is now open (see recent commits :)