mirror of
https://github.com/espressif/openthread.git
synced 2026-08-09 04:07:47 +00:00
[ip6] revert allowing sending packet with hop limit 0 (#3092)
This commit is contained in:
@@ -138,7 +138,7 @@ otError Ip6::AddTunneledMplOption(Message &aMessage, Header &aHeader, MessageInf
|
||||
messageInfo.GetPeerAddr().mFields.m16[7] = HostSwap16(0x00fc);
|
||||
|
||||
tunnelHeader.Init();
|
||||
tunnelHeader.SetHopLimit(kDefaultHopLimit);
|
||||
tunnelHeader.SetHopLimit(static_cast<uint8_t>(kDefaultHopLimit));
|
||||
tunnelHeader.SetPayloadLength(aHeader.GetPayloadLength() + sizeof(tunnelHeader));
|
||||
tunnelHeader.SetDestination(messageInfo.GetPeerAddr());
|
||||
tunnelHeader.SetNextHeader(kProtoIp6);
|
||||
@@ -361,7 +361,7 @@ otError Ip6::SendDatagram(Message &aMessage, MessageInfo &aMessageInfo, IpProto
|
||||
header.Init();
|
||||
header.SetPayloadLength(payloadLength);
|
||||
header.SetNextHeader(aIpProto);
|
||||
header.SetHopLimit(aMessageInfo.mHopLimit);
|
||||
header.SetHopLimit(aMessageInfo.mHopLimit ? aMessageInfo.mHopLimit : static_cast<uint8_t>(kDefaultHopLimit));
|
||||
|
||||
if (aMessageInfo.GetSockAddr().IsUnspecified() || aMessageInfo.GetSockAddr().IsMulticast())
|
||||
{
|
||||
|
||||
+1
-11
@@ -59,11 +59,7 @@ public:
|
||||
* This constructor initializes the object.
|
||||
*
|
||||
*/
|
||||
MessageInfo(void)
|
||||
{
|
||||
memset(this, 0, sizeof(*this));
|
||||
mHopLimit = kDefaultHopLimit;
|
||||
}
|
||||
MessageInfo(void) { memset(this, 0, sizeof(*this)); }
|
||||
|
||||
/**
|
||||
* This method returns a reference to the local socket address.
|
||||
@@ -184,12 +180,6 @@ public:
|
||||
*
|
||||
*/
|
||||
void SetLinkInfo(const void *aLinkInfo) { mLinkInfo = aLinkInfo; }
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
kDefaultHopLimit = OPENTHREAD_CONFIG_IPV6_DEFAULT_HOP_LIMIT,
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user