Skip to content
Commit 39bf1264 authored by Siddharth Chandrasekaran's avatar Siddharth Chandrasekaran Committed by Stephanos Ioannidis
Browse files

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: default avatarSiddharth Chandrasekaran <sidcha.dev@gmail.com>
parent 7f70d5e0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment