mgmt/osdp: pd: Fix error reply code for CMD_KEYSET
By default, on errors, pd_decode_command replies with osdp_NAK with sub-error code set to OSDP_PD_NAK_CMD_LEN (achieved using the ret == OSDP_PD_ERR_GENERIC check before return). This is works for all packet framing errors; but when a more specific error code needs to be sent, ret has to be set to something other than OSDP_PD_ERR_GENERIC (a suitable error code happens to be OSDP_PD_ERR_REPLY) to prevent the tail check from overwriting the error info. In CMD_KEYSET, we fill a more specific error code but do not set the ret to OSDP_PD_ERR_REPLY. It causes this error to be reported as a framing error hence loosing some extended info about the error. Fix this issue by reordering the checks a bit. Fixes: 7f4d2c74 "mgmt/osdp: Add support for Secure Channel" Signed-off-by:Siddharth Chandrasekaran <sidcha.dev@gmail.com>
Loading
Please sign in to comment