net: l2: ieee802154: Fix a wrong channel change during association

The current association logic starts by changing the channel. The way it
is done is wrong because it dereferences req->channel which is simply
not initialized by the caller. But anyway, the command itself does not
support providing a channel so we must already be on the right one when
trying to associate. Hence, drop this channel change call.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
Miquel Raynal 2022-09-04 16:06:50 +02:00 committed by Carles Cufí
commit 6a11e79b4b

View file

@ -353,12 +353,6 @@ static int ieee802154_associate(uint32_t mgmt_request, struct net_if *iface,
params.dst.pan_id = req->pan_id;
params.pan_id = req->pan_id;
/* Set channel first */
if (ieee802154_set_channel(iface, req->channel)) {
ret = -EIO;
goto out;
}
pkt = ieee802154_create_mac_cmd_frame(
iface, IEEE802154_CFI_ASSOCIATION_REQUEST, &params);
if (!pkt) {