net: l2: ieee802154: Align LL address update routine

IEEE802154 L2 may modify the LL address during interface operation (when
processing MAC command). So far the L2 workaround the LL address update
protection by clearing the NET_IF_UP flag temporarily, but due to recent
changes it no longer works. Update this workaround to verify
NET_IF_RUNNING flag instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2022-12-12 11:53:07 +01:00 committed by Carles Cufí
commit a60f32549e

View file

@ -203,11 +203,11 @@ static inline void update_net_if_link_addr(struct net_if *iface, struct ieee8021
{
bool was_if_up;
was_if_up = net_if_flag_test_and_clear(iface, NET_IF_UP);
was_if_up = net_if_flag_test_and_clear(iface, NET_IF_RUNNING);
net_if_set_link_addr(iface, ctx->linkaddr.addr, ctx->linkaddr.len, ctx->linkaddr.type);
if (was_if_up) {
net_if_flag_set(iface, NET_IF_UP);
net_if_flag_set(iface, NET_IF_RUNNING);
}
}