1
0
Fork 0
forked from nuttx/nuttx-update

Oops... Last commit had some garbage in the file

This commit is contained in:
Gregory Nutt 2016-10-24 15:36:11 -06:00
parent 3d4ce55ebd
commit de6db52b52

View file

@ -429,52 +429,58 @@ static void tun_net_receive(FAR struct tun_device_s *priv)
#if defined(CONFIG_NET_IPv4)
ninfo("IPv4 frame\n");
NETDEV_RXIPV4(&priv->dev);
#################################################################################
@@ -429,20 +431,27 @@ static void tun_receive(FAR struct tun_device_s *priv)
/* Give the IPv4 packet to the network layer */
/* Give the IPv4 packet to the network layer. ipv4_input will return
* an error if it is unable to dispatch the packet at this time.
*/
ret = ipv4_input(&priv->dev);
ret = ipv4_input(&priv->dev);
if (ret == OK)
{
/* If the above function invocation resulted in data that should be
* sent out on the network, the field d_len will set to a value > 0.
*/
if (ret == OK)
if (priv->dev.d_len > 0)
{
/* If the above function invocation resulted in data that should be
* sent out on the network, the field d_len will set to a value > 0.
*/
if (priv->dev.d_len > 0)
{
priv->write_d_len = priv->dev.d_len;
tun_fd_transmit(priv);
}
else
{
tun_pollnotify(priv, POLLOUT);
}
priv->write_d_len = priv->dev.d_len;
tun_fd_transmit(priv);
}
else
{
priv->dev.d_len = 0;
tun_pollnotify(priv, POLLOUT);
}
}
else
{
priv->dev.d_len = 0;
tun_pollnotify(priv, POLLOUT);
}
#elif defined(CONFIG_NET_IPv6)
ninfo("Iv6 frame\n");
NETDEV_RXIPV6(&priv->dev);
/* Give the IPv6 packet to the network layer */
ipv6_input(&priv->dev);
/* If the above function invocation resulted in data that should be
* sent out on the network, the field d_len will set to a value > 0.
/* Give the IPv6 packet to the network layer. ipv6_input will return
* an error if it is unable to dispatch the packet at this time.
*/
if (priv->dev.d_len > 0)
ret = ipv6_input(&priv->dev);
if (ret == OK)
{
priv->write_d_len = priv->dev.d_len;
tun_fd_transmit(priv);
/* If the above function invocation resulted in data that should be
* sent out on the network, the field d_len will set to a value > 0.
*/
if (priv->dev.d_len > 0)
{
priv->write_d_len = priv->dev.d_len;
tun_fd_transmit(priv);
}
else
{
tun_pollnotify(priv, POLLOUT);
}
}
else
{