net: l2: ieee802154: Change the hardware filters while associating
During an association, the peer we are trying to connect to will send us an association response frame with the destination PAN ID set to the PAN ID we try to join. If we do not update the hardware address filters beforehands, it is likely that the hardware will just discard the response and the association will fail. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
19e67800f9
commit
31b35973e3
1 changed files with 6 additions and 0 deletions
|
@ -381,6 +381,8 @@ static int ieee802154_associate(uint32_t mgmt_request, struct net_if *iface,
|
|||
|
||||
ieee802154_mac_cmd_finalize(pkt, IEEE802154_CFI_ASSOCIATION_REQUEST);
|
||||
|
||||
ieee802154_filter_pan_id(iface, req->pan_id);
|
||||
|
||||
if (net_if_send_data(iface, pkt)) {
|
||||
net_pkt_unref(pkt);
|
||||
ret = -EIO;
|
||||
|
@ -432,6 +434,10 @@ static int ieee802154_associate(uint32_t mgmt_request, struct net_if *iface,
|
|||
}
|
||||
|
||||
out:
|
||||
if (ret < 0) {
|
||||
ieee802154_filter_pan_id(iface, 0);
|
||||
}
|
||||
|
||||
k_sem_give(&ctx->ctx_lock);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue