diff --git a/arch/xtensa/src/esp32/esp32_clockconfig.c b/arch/xtensa/src/esp32/esp32_clockconfig.c index 73abcac8e2..2da4e0b4de 100644 --- a/arch/xtensa/src/esp32/esp32_clockconfig.c +++ b/arch/xtensa/src/esp32/esp32_clockconfig.c @@ -72,7 +72,9 @@ enum xtal_freq_e void esp32_clockconfig(void) { -#ifndef CONFIG_SUPPRESS_CLOCK_CONFIG +#ifdef CONFIG_SUPPRESS_CLOCK_CONFIG +# warning WARNING: Clock coniguration disabled +#else uint32_t freq_mhz = CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ; enum xtal_freq_e freq; diff --git a/drivers/net/tun.c b/drivers/net/tun.c index fc1425a768..a8b76290c4 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -429,24 +429,34 @@ 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(&priv->dev); + ret = ipv4_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. - */ + 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 (priv->dev.d_len > 0) - { - priv->write_d_len = priv->dev.d_len; - tun_transmit(priv); - } - else - { - priv->write_d_len = 0; - tun_pollnotify(priv, POLLOUT); + if (priv->dev.d_len > 0) + { + priv->write_d_len = priv->dev.d_len; + tun_fd_transmit(priv); + } + else + { + tun_pollnotify(priv, POLLOUT); + } + } + else + { + priv->dev.d_len = 0; + tun_pollnotify(priv, POLLOUT); + } } #elif defined(CONFIG_NET_IPv6) @@ -464,7 +474,7 @@ static void tun_net_receive(FAR struct tun_device_s *priv) if (priv->dev.d_len > 0) { priv->write_d_len = priv->dev.d_len; - tun_transmit(priv); + tun_fd_transmit(priv); } else {