net: l2: ieee802154: Avoid dangling MAC command bits
While the packet structures seem to always be reset when they are allocated, it's apparently not the case of the data buffers. Indeed, these are allocated differently and just attached to the packet structure through a frag/buffer member. Experience shows that we may get uninitialized buffers so let's set all MAC parameter bits one by one, even the reserved ones. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
2fd336c5d2
commit
19e67800f9
1 changed files with 2 additions and 0 deletions
|
@ -367,9 +367,11 @@ static int ieee802154_associate(uint32_t mgmt_request, struct net_if *iface,
|
|||
}
|
||||
|
||||
cmd = ieee802154_get_mac_command(pkt);
|
||||
cmd->assoc_req.ci.reserved_1 = 0U; /* Reserved */
|
||||
cmd->assoc_req.ci.dev_type = 0U; /* RFD */
|
||||
cmd->assoc_req.ci.power_src = 0U; /* TODO: set right power source */
|
||||
cmd->assoc_req.ci.rx_on = 1U; /* TODO: that will depends on PM */
|
||||
cmd->assoc_req.ci.reserved_2 = 0U; /* Reserved */
|
||||
cmd->assoc_req.ci.sec_capability = 0U; /* TODO: security support */
|
||||
cmd->assoc_req.ci.alloc_addr = 0U; /* TODO: handle short addr */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue