Skip to content

Commit

Permalink
Ignore invalid function codes sent to other servers
Browse files Browse the repository at this point in the history
  • Loading branch information
carlfriess committed Dec 13, 2024
1 parent a1705c0 commit c81ad17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nanomodbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,8 @@ static nmbs_error handle_req_fc(nmbs_t* nmbs) {
#endif
default:
flush(nmbs);
err = send_exception_msg(nmbs, NMBS_EXCEPTION_ILLEGAL_FUNCTION);
if (!nmbs->msg.ignored && !nmbs->msg.broadcast)
err = send_exception_msg(nmbs, NMBS_EXCEPTION_ILLEGAL_FUNCTION);
}

return err;
Expand Down

0 comments on commit c81ad17

Please sign in to comment.