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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8f72799e8e net: Fix frame count check fail
8f72799e8e is described below

commit 8f72799e8ed396b4bf3a2ccf7c7e6e2742cdde37
Author: larry <la...@transtekcorp.com>
AuthorDate: Wed Jul 13 14:02:04 2022 +0800

    net: Fix frame count check fail
    
    bc_rxtail/rxtail should always point to newly frame.
    If input more than one frame before receive,
    missing assignment can result in old frame lost.
    
    Signed-off-by: larry <la...@transtekcorp.com>
---
 net/bluetooth/bluetooth_input.c   | 2 ++
 net/ieee802154/ieee802154_input.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/net/bluetooth/bluetooth_input.c b/net/bluetooth/bluetooth_input.c
index 23e1a568fb..345d0ea176 100644
--- a/net/bluetooth/bluetooth_input.c
+++ b/net/bluetooth/bluetooth_input.c
@@ -129,6 +129,8 @@ static int bluetooth_queue_frame(FAR struct 
bluetooth_conn_s *conn,
       conn->bc_rxtail->bn_flink = container;
     }
 
+  conn->bc_rxtail = container;
+
 #if CONFIG_NET_BLUETOOTH_BACKLOG > 0
   /* If incrementing the count would exceed the maximum bc_backlog value,
    * then delete the oldest frame from the head of the RX queue.
diff --git a/net/ieee802154/ieee802154_input.c 
b/net/ieee802154/ieee802154_input.c
index 40689fef71..c527c4da4b 100644
--- a/net/ieee802154/ieee802154_input.c
+++ b/net/ieee802154/ieee802154_input.c
@@ -136,6 +136,8 @@ static int ieee802154_queue_frame(FAR struct 
ieee802154_conn_s *conn,
       conn->rxtail->ic_flink = container;
     }
 
+  conn->rxtail = container;
+
 #if CONFIG_NET_IEEE802154_BACKLOG > 0
   /* If incrementing the count would exceed the maximum backlog value, then
    * delete the oldest frame from the head of the RX queue.

Reply via email to