Explorar o código

Fix handling of invalid function code (closes #315)

Thanks to paperwork
Stéphane Raimbault %!s(int64=9) %!d(string=hai) anos
pai
achega
89998d4c28
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/modbus.c

+ 1 - 1
src/modbus.c

@@ -1027,7 +1027,7 @@ int modbus_reply(modbus_t *ctx, const uint8_t *req,
 
     default:
         rsp_length = response_exception(
-            ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_FUNCTION, rsp, FALSE,
+            ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_FUNCTION, rsp, TRUE,
             "Unknown Modbus function code: 0x%0X\n", function);
         break;
     }