diff --git a/src/core/mac/mac_frame.cpp b/src/core/mac/mac_frame.cpp index f945e529b..7d30aa186 100644 --- a/src/core/mac/mac_frame.cpp +++ b/src/core/mac/mac_frame.cpp @@ -891,8 +891,7 @@ exit: uint8_t Frame::FindPayloadIndex(void) const { - uint16_t fcf = GetFrameControlField(); - uint8_t index = SkipSecurityHeaderIndex(); + uint8_t index = SkipSecurityHeaderIndex(); #if OPENTHREAD_CONFIG_ENABLE_TIME_SYNC uint8_t *cur = NULL; uint8_t *footer = GetFooter(); @@ -929,7 +928,7 @@ uint8_t Frame::FindPayloadIndex(void) const #endif // Command ID - if ((fcf & kFcfFrameTypeMask) == kFcfFrameMacCmd) + if ((GetFrameControlField() & kFcfFrameTypeMask) == kFcfFrameMacCmd) { index += kCommandIdSize; }