mirror of
https://github.com/espressif/openthread.git
synced 2026-08-24 03:09:52 +00:00
[mesh-forwarder] allow last 6LoWPAN fragment to use longer length (#4945)
This commit relaxes the length check for the last 6LoWPAN fragment of a message. The length of a 6LoWPAN fragment is truncated to be a multiple of eight bytes (since fragment offset can be only expressed as multiples of eight). However this requirement does not apply to the last fragment. This change helps avoid an unnecessary extra fragment for messages of certain length.
This commit is contained in:
committed by
Jonathan Hui
parent
2f683e6e76
commit
48086040b7
@@ -770,11 +770,11 @@ start:
|
||||
payload += fragmentHeaderLength;
|
||||
headerLength += fragmentHeaderLength;
|
||||
|
||||
fragmentLength = (aFrame.GetMaxPayloadLength() - headerLength) & ~0x7;
|
||||
fragmentLength = aFrame.GetMaxPayloadLength() - headerLength;
|
||||
|
||||
if (payloadLength > fragmentLength)
|
||||
{
|
||||
payloadLength = fragmentLength;
|
||||
payloadLength = (fragmentLength & ~0x7);
|
||||
}
|
||||
|
||||
// Copy IPv6 Payload
|
||||
|
||||
Reference in New Issue
Block a user