From 73b7e646035f115a1faec00f38654b5ddb86a68b Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Mon, 24 Jul 2023 14:23:22 +0900 Subject: [PATCH] lrwpan: Remove unnecessary Bcst filter from MAC --- CHANGES.md | 1 + RELEASE_NOTES.md | 2 ++ src/lr-wpan/model/lr-wpan-mac.cc | 15 --------------- src/lr-wpan/test/lr-wpan-mac-test.cc | 14 +++++++++++--- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f4d7adbf1..00ac6fe22 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ Changes from ns-3.39 to ns-3-dev * (energy) Added `GenericBatteryModel` to the energy module with working examples. * (energy) Support for battery presets and cell packs. * (energy) Documentation was updated and reformatted. +* (lr-wpan) Removed unnecessary bcst filter from `LrWpanMac::PdDataIndication` which also blocked the correct reception of beacon request commands. ### Changes to build system diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 86442f0c3..91d084206 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -25,6 +25,8 @@ Release 3-dev ### Bugs fixed +- (lr-wpan) - !1591 - Removed unnecessary Bcst filter from MAC + Release 3.39 ------------ diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 94cd8d45a..15100266d 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -1974,21 +1974,6 @@ LrWpanMac::PdDataIndication(uint32_t psduLength, Ptr p, uint8_t lqi) (m_macPanId == 0xffff && receivedMacHdr.IsCommand()); } - if (acceptFrame && (receivedMacHdr.GetShortDstAddr() == Mac16Address("FF:FF"))) - { - // TODO: shouldn't this be filtered by the PHY? - // A broadcast message (e.g. beacons, orphan notifications) should not be received - // by the device who issues it. - if (receivedMacHdr.GetSrcAddrMode() == EXT_ADDR) - { - acceptFrame = (receivedMacHdr.GetExtSrcAddr() != GetExtendedAddress()); - } - else - { - acceptFrame = (receivedMacHdr.GetShortSrcAddr() != GetShortAddress()); - } - } - if (acceptFrame && (receivedMacHdr.GetDstAddrMode() == SHORT_ADDR)) { if (receivedMacHdr.GetShortDstAddr() == m_shortAddress) diff --git a/src/lr-wpan/test/lr-wpan-mac-test.cc b/src/lr-wpan/test/lr-wpan-mac-test.cc index 9f77df6f8..c7cedfa21 100644 --- a/src/lr-wpan/test/lr-wpan-mac-test.cc +++ b/src/lr-wpan/test/lr-wpan-mac-test.cc @@ -308,6 +308,7 @@ class TestActiveScanPanDescriptors : public TestCase * \param params MLME scan confirm parameters */ void ScanConfirm(MlmeScanConfirmParams params); + /** * Function used to notify the reception of a beacon with payload. * @@ -380,9 +381,16 @@ TestActiveScanPanDescriptors::DoRun() Ptr endNodeNetDevice = CreateObject(); Ptr coord2NetDevice = CreateObject(); - coord1NetDevice->SetAddress(Mac16Address("00:01")); - endNodeNetDevice->SetAddress(Mac16Address("00:02")); - coord2NetDevice->SetAddress(Mac16Address("00:03")); + // PAN coordinators typically have a short address = 00:00 (e.g. Zigbee networks) + coord1NetDevice->GetMac()->SetExtendedAddress("00:00:00:00:00:00:CA:FE"); + coord1NetDevice->GetMac()->SetShortAddress(Mac16Address("00:00")); + + coord2NetDevice->GetMac()->SetExtendedAddress("00:00:00:00:00:00:BE:BE"); + coord2NetDevice->GetMac()->SetShortAddress(Mac16Address("00:00")); + + // An end device currently not associated (short address = ff:ff) + endNodeNetDevice->GetMac()->SetExtendedAddress("00:00:00:00:00:00:00:03"); + endNodeNetDevice->GetMac()->SetShortAddress(Mac16Address("ff:ff")); // Configure Spectrum channel Ptr channel = CreateObject();