mirror of
https://github.com/espressif/openthread.git
synced 2026-10-03 06:17:41 +00:00
Return NotFound error when the TLV cannot be found. (#1374)
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Thread {
|
|||||||
|
|
||||||
ThreadError Tlv::Get(const Message &aMessage, uint8_t aType, uint16_t aMaxLength, Tlv &aTlv)
|
ThreadError Tlv::Get(const Message &aMessage, uint8_t aType, uint16_t aMaxLength, Tlv &aTlv)
|
||||||
{
|
{
|
||||||
ThreadError error = kThreadError_Parse;
|
ThreadError error = kThreadError_NotFound;
|
||||||
uint16_t offset;
|
uint16_t offset;
|
||||||
|
|
||||||
SuccessOrExit(error = GetOffset(aMessage, aType, offset));
|
SuccessOrExit(error = GetOffset(aMessage, aType, offset));
|
||||||
@@ -58,7 +58,7 @@ exit:
|
|||||||
|
|
||||||
ThreadError Tlv::GetOffset(const Message &aMessage, uint8_t aType, uint16_t &aOffset)
|
ThreadError Tlv::GetOffset(const Message &aMessage, uint8_t aType, uint16_t &aOffset)
|
||||||
{
|
{
|
||||||
ThreadError error = kThreadError_Parse;
|
ThreadError error = kThreadError_NotFound;
|
||||||
uint16_t offset = aMessage.GetOffset();
|
uint16_t offset = aMessage.GetOffset();
|
||||||
uint16_t end = aMessage.GetLength();
|
uint16_t end = aMessage.GetLength();
|
||||||
Tlv tlv;
|
Tlv tlv;
|
||||||
@@ -93,7 +93,7 @@ exit:
|
|||||||
|
|
||||||
ThreadError Tlv::GetValueOffset(const Message &aMessage, uint8_t aType, uint16_t &aOffset, uint16_t &aLength)
|
ThreadError Tlv::GetValueOffset(const Message &aMessage, uint8_t aType, uint16_t &aOffset, uint16_t &aLength)
|
||||||
{
|
{
|
||||||
ThreadError error = kThreadError_Parse;
|
ThreadError error = kThreadError_NotFound;
|
||||||
uint16_t offset = aMessage.GetOffset();
|
uint16_t offset = aMessage.GetOffset();
|
||||||
uint16_t end = aMessage.GetLength();
|
uint16_t end = aMessage.GetLength();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user