Skip to content
Snippets Groups Projects
Commit 42514625 authored by Max Neklyudov's avatar Max Neklyudov Committed by Gregory Nutt
Browse files

Network drivers: Fix bug in tun interface driver. From Max Neklyudov

parent 51f386d0
No related branches found
No related tags found
No related merge requests found
......@@ -10831,4 +10831,5 @@
General the MS5805 altimeter driver to support other family
members and rename to ms58xx. From Paul Alexander Patience
(2015-08-14).
* Network drivers. Fix bug in tun interface driver. From Max
Neklyudov (2015-08-17).
......@@ -9243,11 +9243,16 @@ detailed bugfix information):
NuttX-7.11 Release Notes
------------------------
The 111th release of NuttX, Version 7.11, was made on June 9, 2015,
The 111th release of NuttX, Version 7.11, was made on August 13 2015,
and is available for download from the Bitbucket.org website. Note
that release consists of two tarballs: nuttx-7.11.tar.gz and
apps-7.11.tar.gz. Both may be needed (see the top-level nuttx/README.txt
file for build information).
apps-7.11.tar.gz. These are available from:
https://bitbucket.org/patacongo/nuttx/downloads
https://bitbucket.org/nuttx/apps/downloads
Both may be needed (see the top-level nuttx/README.txt file for build
information).
Additional new features and extended functionality:
......
......@@ -378,6 +378,7 @@ static int tun_txpoll(struct net_driver_s *dev)
{
/* Send the packet */
priv->read_d_len = priv->dev.d_len;
tun_transmit(priv);
return 1;
......@@ -511,7 +512,6 @@ static void tun_txdone(FAR struct tun_device_s *priv)
priv->dev.d_buf = priv->read_buf;
(void)devif_poll(&priv->dev, tun_txpoll);
priv->read_d_len = priv->dev.d_len;
}
/****************************************************************************
......@@ -537,14 +537,13 @@ static void tun_poll_process(FAR struct tun_device_s *priv)
* the TX poll if he are unable to accept another packet for transmission.
*/
/* If so, update TCP timing states and poll uIP for new XMIT data. Hmmm..
* might be bug here. Does this mean if there is a transmit in progress,
* we will missing TCP time state updates?
*/
if (priv->read_d_len == 0)
{
/* If so, poll uIP for new XMIT data. */
priv->dev.d_buf = priv->read_buf;
(void)devif_timer(&priv->dev, tun_txpoll, TUN_POLLHSEC);
priv->read_d_len = priv->dev.d_len;
priv->dev.d_buf = priv->read_buf;
(void)devif_timer(&priv->dev, tun_txpoll, TUN_POLLHSEC);
}
/* Setup the watchdog poll timer again */
......@@ -576,9 +575,13 @@ static void tun_poll_work(FAR void *arg)
/* Perform the poll */
tun_lock(priv);
state = net_lock();
tun_poll_process(priv);
net_unlock(state);
tun_unlock(priv);
}
#endif
......@@ -757,7 +760,6 @@ static int tun_txavail(struct net_driver_s *dev)
priv->dev.d_buf = priv->read_buf;
(void)devif_poll(&priv->dev, tun_txpoll);
priv->read_d_len = priv->dev.d_len;
}
net_unlock(state);
......
......@@ -56,7 +56,9 @@
/* TUNSETIFF ifr flags */
#define IFF_TUN 0x0001
#define IFF_TUN 0x01
#define IFF_TAP 0x02
#define IFF_NO_PI 0x80
/****************************************************************************
* Public Type Definitions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment