[routing-manager] append source link-layer option in ND6 message (#10647)

This commit introduces a platform API to get the InfraIf link-layer
address. And add the source link-layer address option to all ND6
messages generated from OpenThread.
This commit is contained in:
Zhangwx
2024-10-11 10:12:38 -07:00
committed by GitHub
parent c4262af670
commit 87474bdc88
9 changed files with 220 additions and 84 deletions
+5 -5
View File
@@ -126,7 +126,7 @@ static otRadioFrame sRadioTxFrame;
static uint8_t sRadioTxFramePsdu[OT_RADIO_FRAME_MAX_SIZE];
static bool sRadioTxOngoing = false;
using Icmp6Packet = Ip6::Nd::RouterAdvert::Icmp6Packet;
using Icmp6Packet = Ip6::Nd::Icmp6Packet;
enum ExpectedPio
{
@@ -332,12 +332,12 @@ otError otPlatInfraIfSendIcmp6Nd(uint32_t aInfraIfIndex,
case Ip6::Icmp::Header::kTypeNeighborSolicit:
{
const Ip6::Nd::NeighborSolicitMessage *nsMsg =
reinterpret_cast<const Ip6::Nd::NeighborSolicitMessage *>(packet.GetBytes());
const Ip6::Nd::NeighborSolicitHeader *nsMsg =
reinterpret_cast<const Ip6::Nd::NeighborSolicitHeader *>(packet.GetBytes());
Log(" Neighbor Solicit message");
VerifyOrQuit(packet.GetLength() >= sizeof(Ip6::Nd::NeighborSolicitMessage));
VerifyOrQuit(packet.GetLength() >= sizeof(Ip6::Nd::NeighborSolicitHeader));
VerifyOrQuit(nsMsg->IsValid());
sNsEmitted = true;
@@ -875,7 +875,7 @@ void BuildRouterAdvert(Ip6::Nd::RouterAdvert::TxMessage &aRaMsg,
header.SetSnacRouterFlag();
}
SuccessOrQuit(aRaMsg.AppendHeader(header));
SuccessOrQuit(aRaMsg.Append(header));
for (; aNumPios > 0; aPios++, aNumPios--)
{