From 872913e67b2decab4d9ef9a1d52ef01bd0699365 Mon Sep 17 00:00:00 2001 From: xucheng5 Date: Thu, 27 Jul 2023 15:19:46 +0800 Subject: [PATCH] netdev_upperhalf: reply logic only for ipv4/ipv6/arp input VELAPLATFO-12228 Signed-off-by: xucheng5 --- drivers/net/netdev_upperhalf.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/netdev_upperhalf.c b/drivers/net/netdev_upperhalf.c index d4b4c92e11..a9f32cd93a 100644 --- a/drivers/net/netdev_upperhalf.c +++ b/drivers/net/netdev_upperhalf.c @@ -381,6 +381,18 @@ static void eth_input(FAR struct net_driver_s *dev) NETDEV_RXDROPPED(dev); 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 (dev->d_len > 0) + { + /* And send the packet */ + + netdev_upper_txpoll(dev); + } } #endif @@ -454,18 +466,6 @@ static void netdev_upper_rxpoll_work(FAR struct netdev_upperhalf_s *upper) nerr("Unknown link type %d\n", dev->d_lltype); break; } - - /* 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 (dev->d_len > 0) - { - /* And send the packet */ - - netdev_upper_txpoll(dev); - } } }