You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/08/03 09:15:48 UTC
(nuttx) 02/02: net/sixlowpan: Fix protosize to 16-bit
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch releases/13.0
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 96daab367a7fe4fd6ff06a65cff925affccb1ba0
Author: Alan Carvalho de Assis <ac...@gmail.com>
AuthorDate: Sun May 3 15:57:35 2026 -0300
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-by: Alan C. Assis <ac...@gmail.com>
---
net/sixlowpan/sixlowpan_input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sixlowpan/sixlowpan_input.c b/net/sixlowpan/sixlowpan_input.c
index 402587c1093..8bf1cbf9dfd 100644
--- a/net/sixlowpan/sixlowpan_input.c
+++ b/net/sixlowpan/sixlowpan_input.c
@@ -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 */