net: ip: net_pkt_pull(): packet corruption when using CONFIG_NET_BUF_DATA_SIZE larger than 256 #22307
Labels
area: Networking
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
CONFIG_NET_BUF_DATA_SIZE
has a default of 128.When using
CONFIG_NET_BUF_FIXED_DATA_SIZE=y
andCONFIG_NET_BUF_DATA_SIZE
> 256 (e.g. 512),net_pkt_pull()
corrupts the packet, as it calculates the lengths usingu8_t
.This can be reproduced when using ipv6 with packet fragmentation. The packet reassembling code uses
net_pkt_pull()
on received packets.You can send large ipv6 pings (e.g.
ping6 -s 2000 192.0.2.2
) to see the corrupted dataImpact
This is a showstopper when working with fragmented IPV6 packets.
Environment (please complete the following information):
Additional context
The solution is to change the type of
left, rem
fromu8_t
tosize_t
:The text was updated successfully, but these errors were encountered: