ICMPv6: Support source link-layer address option in RA

This commit is contained in:
Masayuki Ishikawa 2017-08-08 13:36:44 +09:00 committed by Masayuki Ishikawa
parent d5c91f9a57
commit bac67455b6

View File

@ -255,6 +255,14 @@ void icmpv6_input(FAR struct net_driver_s *dev)
for (ndx = 0; ndx + sizeof(struct icmpv6_prefixinfo_s) <= optlen; ) for (ndx = 0; ndx + sizeof(struct icmpv6_prefixinfo_s) <= optlen; )
{ {
FAR struct icmpv6_srclladdr_s *sllopt =
(FAR struct icmpv6_srclladdr_s *)&options[ndx];
if (sllopt->opttype == 1 && sllopt->optlen == 1)
{
neighbor_add(icmp->srcipaddr, DEV_LLTYPE(dev), sllopt->srclladdr);
}
FAR struct icmpv6_prefixinfo_s *opt = FAR struct icmpv6_prefixinfo_s *opt =
(FAR struct icmpv6_prefixinfo_s *)&options[ndx]; (FAR struct icmpv6_prefixinfo_s *)&options[ndx];