diff --git a/src/cmdu_validate.c b/src/cmdu_validate.c index 868c0a6d0136606161caef0db0ebc750cdccea00..74d3547da1c399f5678349302e778fb4e5aa81a6 100644 --- a/src/cmdu_validate.c +++ b/src/cmdu_validate.c @@ -2,6 +2,7 @@ #include <map2.h> #include <cmdu.h> #include "cmdu_validate.h" +#include "debug.h" bool validate_channel_scan_report(struct cmdu_buff *cmdu, struct tlv *tv_tsp[][16], @@ -107,6 +108,16 @@ bool validate_channel_scan_report(struct cmdu_buff *cmdu, struct tlv *tv_tsp[][1 } } + if (!tv_tsp[0][0]) { + dbg("%s: No TIMESTAMP_TLV received!\n", __func__); + return false; + } + + if (!tv_scan[0]) { + dbg("%s: No RESULT_TLV received!\n", __func__); + return false; + } + return true; } diff --git a/src/cntlr_map.c b/src/cntlr_map.c index c07162187ba955b36950f2edafbc6251019f4f1b..fdf09586dcef95c27200e27e37efc93d2a763b49 100644 --- a/src/cntlr_map.c +++ b/src/cntlr_map.c @@ -2049,16 +2049,6 @@ int handle_channel_scan_report(void *cntlr, struct cmdu_buff *cmdu) return -1; } - if (!tv_tsp[0][0]) { - dbg("No TIMESTAMP_TLV received!\n"); - return -1; - } - - if (!tv_scan[0]) { - dbg("No RESULT_TLV received!\n"); - return -1; - } - dbg("\nTLV type: MAP_TLV_TIMESTAMP\n"); tv_data = (uint8_t *)tv_tsp[0][0]->data; p = (struct tlv_timestamp *)tv_data;