[mpl] add extra validation when removing MPL Option (#3851)

This commit is contained in:
Jonathan Hui
2019-05-22 10:57:04 -07:00
committed by GitHub
parent 8d462f316e
commit bcfa791912
+2
View File
@@ -364,6 +364,8 @@ otError Ip6::RemoveMplOption(Message &aMessage)
mplOffset = offset;
mplLength = option.GetLength();
VerifyOrExit(mplLength <= sizeof(OptionMpl) - sizeof(OptionHeader), error = OT_ERROR_PARSE);
if (mplOffset == sizeof(ip6Header) + sizeof(hbh) && hbh.GetLength() == 0)
{
// first and only IPv6 Option, remove IPv6 HBH Option header