Network drivers: Fix bug in tun interface driver. From Max Neklyudov
This commit is contained in:
parent
51f386d08a
commit
425146255a
@ -10831,4 +10831,5 @@
|
|||||||
General the MS5805 altimeter driver to support other family
|
General the MS5805 altimeter driver to support other family
|
||||||
members and rename to ms58xx. From Paul Alexander Patience
|
members and rename to ms58xx. From Paul Alexander Patience
|
||||||
(2015-08-14).
|
(2015-08-14).
|
||||||
|
* Network drivers. Fix bug in tun interface driver. From Max
|
||||||
|
Neklyudov (2015-08-17).
|
||||||
|
11
ReleaseNotes
11
ReleaseNotes
@ -9243,11 +9243,16 @@ detailed bugfix information):
|
|||||||
NuttX-7.11 Release Notes
|
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
|
and is available for download from the Bitbucket.org website. Note
|
||||||
that release consists of two tarballs: nuttx-7.11.tar.gz and
|
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
|
apps-7.11.tar.gz. These are available from:
|
||||||
file for build information).
|
|
||||||
|
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:
|
Additional new features and extended functionality:
|
||||||
|
|
||||||
|
@ -378,6 +378,7 @@ static int tun_txpoll(struct net_driver_s *dev)
|
|||||||
{
|
{
|
||||||
/* Send the packet */
|
/* Send the packet */
|
||||||
|
|
||||||
|
priv->read_d_len = priv->dev.d_len;
|
||||||
tun_transmit(priv);
|
tun_transmit(priv);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -511,7 +512,6 @@ static void tun_txdone(FAR struct tun_device_s *priv)
|
|||||||
|
|
||||||
priv->dev.d_buf = priv->read_buf;
|
priv->dev.d_buf = priv->read_buf;
|
||||||
(void)devif_poll(&priv->dev, tun_txpoll);
|
(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.
|
* 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..
|
if (priv->read_d_len == 0)
|
||||||
* might be bug here. Does this mean if there is a transmit in progress,
|
{
|
||||||
* we will missing TCP time state updates?
|
/* If so, poll uIP for new XMIT data. */
|
||||||
*/
|
|
||||||
|
|
||||||
priv->dev.d_buf = priv->read_buf;
|
priv->dev.d_buf = priv->read_buf;
|
||||||
(void)devif_timer(&priv->dev, tun_txpoll, TUN_POLLHSEC);
|
(void)devif_timer(&priv->dev, tun_txpoll, TUN_POLLHSEC);
|
||||||
priv->read_d_len = priv->dev.d_len;
|
}
|
||||||
|
|
||||||
/* Setup the watchdog poll timer again */
|
/* Setup the watchdog poll timer again */
|
||||||
|
|
||||||
@ -576,9 +575,13 @@ static void tun_poll_work(FAR void *arg)
|
|||||||
|
|
||||||
/* Perform the poll */
|
/* Perform the poll */
|
||||||
|
|
||||||
|
tun_lock(priv);
|
||||||
state = net_lock();
|
state = net_lock();
|
||||||
|
|
||||||
tun_poll_process(priv);
|
tun_poll_process(priv);
|
||||||
|
|
||||||
net_unlock(state);
|
net_unlock(state);
|
||||||
|
tun_unlock(priv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -757,7 +760,6 @@ static int tun_txavail(struct net_driver_s *dev)
|
|||||||
|
|
||||||
priv->dev.d_buf = priv->read_buf;
|
priv->dev.d_buf = priv->read_buf;
|
||||||
(void)devif_poll(&priv->dev, tun_txpoll);
|
(void)devif_poll(&priv->dev, tun_txpoll);
|
||||||
priv->read_d_len = priv->dev.d_len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
net_unlock(state);
|
net_unlock(state);
|
||||||
|
@ -56,7 +56,9 @@
|
|||||||
|
|
||||||
/* TUNSETIFF ifr flags */
|
/* TUNSETIFF ifr flags */
|
||||||
|
|
||||||
#define IFF_TUN 0x0001
|
#define IFF_TUN 0x01
|
||||||
|
#define IFF_TAP 0x02
|
||||||
|
#define IFF_NO_PI 0x80
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Type Definitions
|
* Public Type Definitions
|
||||||
|
Loading…
Reference in New Issue
Block a user