Fix ICMPv6 RA parsing procedure

Signed-off-by: luojun1 <luojun1@xiaomi.com>
This commit is contained in:
luojun1 2022-12-14 16:42:00 +08:00 committed by archer
parent d8777fa77d
commit 861004725a

View file

@ -312,7 +312,7 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
options = (FAR uint8_t *)adv +
sizeof(struct icmpv6_router_advertise_s);
for (ndx = 0; ndx + sizeof(struct icmpv6_prefixinfo_s) <= optlen; )
for (ndx = 0; ndx < optlen; )
{
FAR struct icmpv6_generic_s *opt =
(FAR struct icmpv6_generic_s *)&options[ndx];
@ -353,7 +353,7 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
{
FAR struct icmpv6_mtu_s *mtuopt =
(FAR struct icmpv6_mtu_s *)opt;
dev->d_pktsize = NTOHL(mtuopt->mtu);
dev->d_pktsize = NTOHL(mtuopt->mtu) + dev->d_llhdrlen;
}
break;