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:
+2
-2
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user