-
Thanks to @peternewman
-
According to the Modbus standard, the unit identifier is choosen by the TCP client and can be any value: "This field is used for intra-system routing purpose. It is typically used to communicate to a MODBUS+ or a MODBUS serial line slave through a gateway between an Ethernet TCP-IP network and a MODBUS serial line. This field is set by the MODBUS Client in the request and must be returned with the same value in the response by the server." So the current check in modbus_reply must be extended to check whether we are in a RTU or TCP context. Also the unit-test has to be adjusted. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
According to the Modbus specification (http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf, section 2.1) a Modbus RTU master can send a broadcast to all of it's slaves. This broadcasts can only be write requests as otherwise collisions could occur, eg. on a RS-485 bus. When receiving such a broadcast, the slave should process the request as usual, but must not reply anything, neither a normal response nor an exception reply in case of an error. Adjust the unit test for this case, too. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
This patch has been developed by Andrey Skvortsov, Michael Heimpold and Stéphane Raimbault. - avoid bash'isms and use of GNU find - terminate server after test run (ignored in TCP mode) - add *.log, *.trs to .gitignore - unit-test-client returns 0 on success - save exit code of unit-test-client for make check status - replace kill by killall - add entry in README
-
This replaces the lengthy license text headers with a short and standardized license tag. See http://spdx.org for details. This is useful e.g. for license compliance tools which scan through files and generate a report of the licenses used in a project. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
The response timeout of the client must be higher than the server to handle sleep/flush operations done on server side.
-
This fixes the message "error: 'for' loop initial declarations are only allowed in C99 mode", spotted during cross-compiling of libmodbus. The compiler (gcc) actually does support -std=c99 but it gets not enabled by default. So a solution would be to enforce c99 mode via CFLAGS, but this will knock out all compilers which do not support this mode. Moving the declaration out of the loop initialisation, seems to be the simpler solution. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
-
It concerns only the files in 'tests' directory.
-
Protects against crafted write requests with a large quantity but a small byte count. If address + quantity was in the mapping space of the server and quantity greater than the response size, it was possible to crash the server. The sleep/flush sequence improves the handling of following requests.
-
- protect against NULL IP address BTW - update documentation
-
- allow an empty string or NULL for node argument - protect against NULL in service argument - new test for NULL service - update documentation
-
It's never too late to remove 261 lines of code ;)
-
Change API of function for libmodbus v3.2.0
-
Thanks to Perry Kundert for bug report and initial patches.
-
- add byte timeout tests (TCP backend only) - update and improve documentation - long timeout values are now uint32_t so it changes the API to disable byte timeout
-
- update documentation - 5 new tests - updated NEWS file - avoid include of time.h
-
It's strongly recommended to update your libmodbus library if you use it in a slave/server application in a not trusted environment. Debian package of libmodbus 3.0.4 already contains a patch to mitigate the exploit but the patch isn't as strong than this one.