Skip to content

net/sixlowpan: Check if g_frame_hdrlen + IPv6_HDRLEN <= iob->io_len#18857

Open
acassis wants to merge 2 commits intoapache:masterfrom
acassis:fix_net_6lowpan_again
Open

net/sixlowpan: Check if g_frame_hdrlen + IPv6_HDRLEN <= iob->io_len#18857
acassis wants to merge 2 commits intoapache:masterfrom
acassis:fix_net_6lowpan_again

Conversation

@acassis
Copy link
Copy Markdown
Contributor

@acassis acassis commented May 8, 2026

Summary

Fix another issue where g_frame_hdrlen is not checked correctly

Impact

Improvement

Testing

$ ./tools/configure.sh b-l475e-iot01a:spirit-6lowpan

@github-actions github-actions Bot added Area: Networking Effects networking subsystem Size: S The size of the change in this PR is small labels May 8, 2026
This commit checks if the incoming 6LoWPAN frame header len + the
IPv6_HDRLEN will fit inside the b->io_len.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
@acassis acassis force-pushed the fix_net_6lowpan_again branch from b2c58db to 10cfc96 Compare May 8, 2026 15:42
Copy link
Copy Markdown
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @acassis :-)

@acassis
Copy link
Copy Markdown
Contributor Author

acassis commented May 8, 2026

@cederom endofframe is where the received data ends, so the test verifies if this position is lesser than the header len. It is confuse to understand if you don't spend some time looking the code

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>
@acassis acassis force-pushed the fix_net_6lowpan_again branch from 10cfc96 to 2f58087 Compare May 8, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Networking Effects networking subsystem Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants