This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 3e18d726619eb42d86c1e18e7bea7367a359f3cf
Author: zhanghongyu <[email protected]>
AuthorDate: Wed Aug 27 21:59:17 2025 +0800

    netdev_upperhalf.c: add vlan lock in rxpoll flow
    
    Protect the RX process of the VLAN network card.
    
    Signed-off-by: zhanghongyu <[email protected]>
---
 drivers/net/netdev_upperhalf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/netdev_upperhalf.c b/drivers/net/netdev_upperhalf.c
index 04cac299730..ed3850db252 100644
--- a/drivers/net/netdev_upperhalf.c
+++ b/drivers/net/netdev_upperhalf.c
@@ -535,6 +535,7 @@ static void eth_input(FAR struct net_driver_s *dev)
            * ethertype.
            */
 
+          netdev_lock(&vlan->netdev);
           memmove((FAR uint8_t *)eth_hdr + 4, eth_hdr,
                   offsetof(struct eth_hdr_s, type));
           netdev_iob_release(&vlan->netdev);
@@ -548,6 +549,7 @@ static void eth_input(FAR struct net_driver_s *dev)
           pkt_input(&vlan->netdev);
 #endif
           eth_input(&vlan->netdev);
+          netdev_unlock(&vlan->netdev);
         }
       else
         {

Reply via email to