libmodbus icon indicating copy to clipboard operation
libmodbus copied to clipboard

Modbus TCP Protocol identifier should be 0

Open metapsychologe opened this issue 6 years ago • 1 comments

https://github.com/stephane/libmodbus/blob/f1eb4bc7ccb09cd8d19ab641ee37637f8c34d16d/src/modbus-tcp.c#L202

shouldn't there be an || instead of an &&?

metapsychologe avatar Dec 08 '19 17:12 metapsychologe

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.

JoelStienlet avatar Dec 08 '19 18:12 JoelStienlet

should this go in quirks to allow other protocols?

karlp avatar Oct 03 '22 22:10 karlp

The gate to quirks is now open (see recent commits :)

stephane avatar Oct 03 '22 23:10 stephane