Update IsValid() for ConnectivityTlv due to optional SED Buffer Size and Datagram Count (#1624)

This commit is contained in:
rongli
2017-04-19 08:42:42 -07:00
committed by Jonathan Hui
parent 3fe8a665eb
commit dac96c2c22
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -1014,7 +1014,8 @@ public:
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() == sizeof(*this) - sizeof(Tlv); }
bool IsValid(void) const { return (GetLength() == sizeof(*this) - sizeof(Tlv) ||
GetLength() == sizeof(*this) - sizeof(Tlv) - sizeof(mSedBufferSize) - sizeof(mSedDatagramCount)); }
/**
* This method returns the Parent Priority value.
+2 -1
View File
@@ -349,7 +349,8 @@ public:
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() == sizeof(*this) - sizeof(NetworkDiagnosticTlv); }
bool IsValid(void) const { return (GetLength() == sizeof(*this) - sizeof(NetworkDiagnosticTlv) ||
GetLength() == sizeof(*this) - sizeof(NetworkDiagnosticTlv) - sizeof(mSedBufferSize) - sizeof(mSedDatagramCount)); }
/**
* This method returns the Parent Priority value.