Skip to content

Commit b2c58db

Browse files
committed
net/sixlowpan: Fix protosize to 16-bit
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-of: Alan C. Assis <acassis@gmail.com>
1 parent 70c3096 commit b2c58db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/sixlowpan/sixlowpan_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
318318
uint16_t paysize; /* Size of the data payload */
319319
uint16_t fragtag = 0; /* Tag of the fragment */
320320
uint8_t fragoffset = 0; /* Offset of the fragment in the IP packet */
321-
uint8_t protosize = 0; /* Length of the protocol header (treated like payload) */
321+
uint16_t protosize = 0; /* Length of the protocol header (treated like payload) */
322322
bool isfrag = false; /* true: Frame is a fragment */
323323
bool isfrag1 = false; /* true: Frame is the first fragment of the series */
324324
int reqsize; /* Required buffer size */

0 commit comments

Comments
 (0)