1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_lorawan: drop frame if port exceeds max app port

This commit is contained in:
Jose Alamos 2021-03-01 15:44:17 +01:00
parent 7cf5530cae
commit dca0b366ac
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9

View File

@ -118,6 +118,11 @@ int gnrc_lorawan_parse_dl(gnrc_lorawan_t *mac, uint8_t *buf, size_t len,
return -1;
}
if (pkt->port > LORAMAC_PORT_MAX) {
DEBUG("gnrc_lorawan: packet with port > 223. Drop\n");
return -1;
}
if (buf < p_mic) {
pkt->enc_payload.iol_base = buf;
pkt->enc_payload.iol_len = p_mic - buf;