1
0
Fork 0
forked from nuttx/nuttx-update

tun: in tun_write, try to release iob before iob_prepare

io_pktlen will incorrect when two packets are received in a row and the packet length decreases.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2023-07-12 20:05:25 +08:00 committed by archer
parent df30a1f8d3
commit e93bdfe089

View file

@ -990,6 +990,7 @@ static ssize_t tun_write(FAR struct file *filep, FAR const char *buffer,
if (priv->write_d_len == 0)
{
net_lock();
netdev_iob_release(&priv->dev);
ret = netdev_iob_prepare(&priv->dev, false, 0);
priv->dev.d_buf = NULL;
if (ret < 0)