net/sixlowpan: Fix protosize to 16-bit
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions

There was another small issue on sixlowpan_input.c code, it was
processing protosize and 8-bit instead of 16-bit.

It was working because the max tcp->tcpoffset was 0xf0, so
protosize = ((uint16_t)tcp->tcpoffset >> 4) << 2;
Will be protosize = 15 * 4 = 60 and will fit inside 8-bit.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
Alan Carvalho de Assis 2026-05-03 15:57:35 -03:00 committed by Xiang Xiao
parent faa5c75f11
commit 564fae94d7

View file

@ -318,7 +318,7 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
uint16_t paysize; /* Size of the data payload */
uint16_t fragtag = 0; /* Tag of the fragment */
uint8_t fragoffset = 0; /* Offset of the fragment in the IP packet */
uint8_t protosize = 0; /* Length of the protocol header (treated like payload) */
uint16_t protosize = 0; /* Length of the protocol header (treated like payload) */
bool isfrag = false; /* true: Frame is a fragment */
bool isfrag1 = false; /* true: Frame is the first fragment of the series */
int reqsize; /* Required buffer size */