Split error handling for accurate log messages in sptps_verify_datagram
"Received short packet" was misleading.
This commit is contained in:
parent
fe18e0ed29
commit
a84019cf10
1 changed files with 4 additions and 2 deletions
|
@ -467,8 +467,10 @@ static bool sptps_check_seqno(sptps_t *s, uint32_t seqno, bool update_state) {
|
||||||
|
|
||||||
// Check datagram for valid HMAC
|
// Check datagram for valid HMAC
|
||||||
bool sptps_verify_datagram(sptps_t *s, const void *data, size_t len) {
|
bool sptps_verify_datagram(sptps_t *s, const void *data, size_t len) {
|
||||||
if(!s->instate || len < 21)
|
if(!s->instate)
|
||||||
return error(s, EIO, "Received short packet");
|
return error(s, EIO, "%s@%d: Invalid instate", __FUNCTION__, __LINE__);
|
||||||
|
if(len < 21)
|
||||||
|
return error(s, EIO, "%s@%d: Received short packet", __FUNCTION__, __LINE__);
|
||||||
|
|
||||||
uint32_t seqno;
|
uint32_t seqno;
|
||||||
memcpy(&seqno, data, 4);
|
memcpy(&seqno, data, 4);
|
||||||
|
|
Loading…
Reference in a new issue