forked from nuttx/nuttx-update
tcp_ofosegs: prepare iob to reset io_offset
The previous iob_trimhead added dev->iob->io_offset, so if the input frame is not merged into the ofo segment, we need to reset dev->iob->io_offset so that the subsequent tcp_send can properly assemble packets. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
398734500e
commit
55d5006462
1 changed files with 5 additions and 5 deletions
|
@ -456,10 +456,9 @@ static void tcp_input_ofosegs(FAR struct net_driver_s *dev,
|
||||||
dev->d_iob = iob_trimhead(dev->d_iob, len);
|
dev->d_iob = iob_trimhead(dev->d_iob, len);
|
||||||
if (dev->d_iob == NULL || dev->d_iob->io_pktlen == 0)
|
if (dev->d_iob == NULL || dev->d_iob->io_pktlen == 0)
|
||||||
{
|
{
|
||||||
/* No available data, clear device buffer */
|
/* No available data, prepare device iob */
|
||||||
|
|
||||||
iob_free_chain(dev->d_iob);
|
goto prepare;
|
||||||
goto clear;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ofoseg.data = dev->d_iob;
|
ofoseg.data = dev->d_iob;
|
||||||
|
@ -517,10 +516,11 @@ static void tcp_input_ofosegs(FAR struct net_driver_s *dev,
|
||||||
|
|
||||||
if (rebuild)
|
if (rebuild)
|
||||||
{
|
{
|
||||||
clear:
|
|
||||||
netdev_iob_clear(dev);
|
netdev_iob_clear(dev);
|
||||||
netdev_iob_prepare(dev, false, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prepare:
|
||||||
|
netdev_iob_prepare(dev, false, 0);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_NET_TCP_OUT_OF_ORDER */
|
#endif /* CONFIG_NET_TCP_OUT_OF_ORDER */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue