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

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

commit 546e68eb6abca7a24aa5b6fad17e96e87ecd2ff3
Author: raiden00pl <[email protected]>
AuthorDate: Fri Oct 16 18:56:25 2026 +0200

    arch/arm/nrf52: fix frame header parsing
    
    The frame parse used for the Frame Pending field of the data request ACK
    skipped the source PAN ID whenever PAN ID Compression was set. IEEE
    802.15.4-2011 5.2.1.1.5 applies it only when both addresses are
    present.
    
    The frame filter compared the destination extended address octets as
    received with the stored address. The MAC stores eaddr[0] as the most
    significant octet and sends the least significant octet first, so frames
    to an extended address other than all zeros or all ones were dropped.
    
    Assisted-by: Claude Code
    Signed-off-by: raiden00pl <[email protected]>
---
 arch/arm/src/nrf52/nrf52_ieee802154_radio.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/arm/src/nrf52/nrf52_ieee802154_radio.c 
b/arch/arm/src/nrf52/nrf52_ieee802154_radio.c
index 282a8aeb3f0..45dfd62aa11 100644
--- a/arch/arm/src/nrf52/nrf52_ieee802154_radio.c
+++ b/arch/arm/src/nrf52/nrf52_ieee802154_radio.c
@@ -330,7 +330,9 @@ static void nrf52_radioi8_rx_parse(struct 
nrf52_radioi8_dev_s *dev,
 
   if (smode != IEEE802154_ADDRMODE_NONE)
     {
-      if (!panid_comp)
+      /* PAN ID compression applies only when both addresses are present */
+
+      if (!panid_comp || dmode == IEEE802154_ADDRMODE_NONE)
         {
           i += IEEE802154_PANIDSIZE;
         }
@@ -448,6 +450,7 @@ static bool nrf52_radioi8_filter(struct nrf52_radioi8_dev_s 
*dev)
   struct ieee802154_addr_s  addr;
   uint8_t                  *rx = &dev->radio->rxbuf[1];
   uint16_t                 *fc = (uint16_t *)&rx[0];
+  int                       i;
 
   /* Promiscuous mode */
 
@@ -475,7 +478,14 @@ static bool nrf52_radioi8_filter(struct 
nrf52_radioi8_dev_s *dev)
     }
   else if (addr.mode == IEEE802154_ADDRMODE_EXTENDED)
     {
-      IEEE802154_EADDRCOPY(addr.eaddr, &rx[5]);
+      /* Sent least significant octet first, eaddr[0] is the most
+       * significant octet
+       */
+
+      for (i = 0; i < IEEE802154_EADDRSIZE; i++)
+        {
+          addr.eaddr[i] = rx[5 + IEEE802154_EADDRSIZE - 1 - i];
+        }
     }
 
   /* PAN ID match */

Reply via email to