Skip to content

Commit 38a742b

Browse files
committed
net: l2: ieee802154: skip filter removal for unassociated values
Trying to remove filter with NOT_ASSOCIATED parameter results in noisy warning logs in most of the radio drivers. It's safe to ignore it as this is an invalid operation. Signed-off-by: Simon Piriou <[email protected]>
1 parent f1c2ce4 commit 38a742b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

subsys/net/l2/ieee802154/ieee802154_utils.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ static inline void ieee802154_radio_remove_src_short_addr(struct net_if *iface,
245245
const struct ieee802154_radio_api *radio =
246246
net_if_get_device(iface)->api;
247247

248-
if (radio && (radio->get_capabilities(net_if_get_device(iface)) &
248+
if (radio && (short_addr != IEEE802154_SHORT_ADDRESS_NOT_ASSOCIATED) &&
249+
(radio->get_capabilities(net_if_get_device(iface)) &
249250
IEEE802154_HW_FILTER)) {
250251
struct ieee802154_filter filter;
251252

@@ -264,7 +265,8 @@ static inline void ieee802154_radio_remove_pan_id(struct net_if *iface, uint16_t
264265
const struct ieee802154_radio_api *radio =
265266
net_if_get_device(iface)->api;
266267

267-
if (radio && (radio->get_capabilities(net_if_get_device(iface)) &
268+
if (radio && (pan_id != IEEE802154_PAN_ID_NOT_ASSOCIATED) &&
269+
(radio->get_capabilities(net_if_get_device(iface)) &
268270
IEEE802154_HW_FILTER)) {
269271
struct ieee802154_filter filter;
270272

0 commit comments

Comments
 (0)