From 37b7c2e90bed30c0cbeb4eaf300240893b082fe0 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Fri, 14 Jul 2017 17:22:08 +0200 Subject: [PATCH] TSCH: log parsing errors even when security is not enabled --- os/net/mac/tsch/tsch-slot-operation.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/os/net/mac/tsch/tsch-slot-operation.c b/os/net/mac/tsch/tsch-slot-operation.c index d84a1998d..715b9463d 100644 --- a/os/net/mac/tsch/tsch-slot-operation.c +++ b/os/net/mac/tsch/tsch-slot-operation.c @@ -763,6 +763,12 @@ PT_THREAD(tsch_rx_slot(struct pt *pt, struct rtimer *t)) packet_duration = TSCH_PACKET_DURATION(current_input->len); + if(!frame_valid) { + TSCH_LOG_ADD(tsch_log_message, + snprintf(log->message, sizeof(log->message), + "!failed to parse frame %u %u", header_len, current_input->len)); + } + if(frame_valid) { if(frame.fcf.frame_type != FRAME802154_DATAFRAME && frame.fcf.frame_type != FRAME802154_BEACONFRAME) { @@ -786,11 +792,6 @@ PT_THREAD(tsch_rx_slot(struct pt *pt, struct rtimer *t)) "!failed to authenticate frame %u", current_input->len)); frame_valid = 0; } - } else { - TSCH_LOG_ADD(tsch_log_message, - snprintf(log->message, sizeof(log->message), - "!failed to parse frame %u %u", header_len, current_input->len)); - frame_valid = 0; } #endif /* LLSEC802154_ENABLED */