LoRa: Stop processing MAC commands if command id is unknown

The length of a MAC command is not explicitly given and must be
implicitly known by the MAC implementation. Therefore unknown MAC
commands cannot be skipped and the first unknown MAC command
terminates the processing of the MAC command sequence.

This commit fixes the bug where MAC command processing was not
terminated when unknown MAC command was received.
pull/8341/head
Kimmo Vaisanen 2018-08-30 15:43:54 +03:00 committed by adbridge
parent 063118ca9d
commit ffa46b15f3
1 changed files with 2 additions and 1 deletions

View File

@ -304,7 +304,8 @@ lorawan_status_t LoRaMacCommand::process_mac_commands(const uint8_t *payload, ui
break; break;
default: default:
// Unknown command. ABORT MAC commands processing // Unknown command. ABORT MAC commands processing
ret_value = LORAWAN_STATUS_UNSUPPORTED; tr_error("Invalid MAC command (0x%X)!", payload[mac_index]);
return LORAWAN_STATUS_UNSUPPORTED;
} }
} }
return ret_value; return ret_value;