Small fix to last commit

If we cannot determine the length of the mac frame body, we should probably not attempt to parse it.
This commit is contained in:
Anton Ottosson
2021-07-13 02:58:23 +02:00
parent 844424404d
commit 45fd47b6ec
+2 -2
View File
@@ -101,13 +101,13 @@ void parse(pmt::pmt_t pdu) {
char *frame = (char*)pmt::blob_data(d_msg); char *frame = (char*)pmt::blob_data(d_msg);
int body_start; int body_start = frame_len;
if((((h->frame_control) >> 2) & 63) == 2) { if((((h->frame_control) >> 2) & 63) == 2) {
body_start = 24; // DATA body_start = 24; // DATA
} else if((((h->frame_control) >> 2) & 63) == 34) { } else if((((h->frame_control) >> 2) & 63) == 34) {
body_start = 26; // QoS Data body_start = 26; // QoS Data
} else return; }
int body_len = frame_len - body_start; int body_len = frame_len - body_start;