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:
parent
df30a1f8d3
commit
e93bdfe089
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue