diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-11-28 12:16:53 +0100 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-12-15 11:14:53 +0100 |
commit | 95d92505b6063896d7a1e6fcadd07e8552653cfb (patch) | |
tree | 05cfc69c4f913fa589238cba512f4a4227971bba /net/mac802154 | |
parent | e9dc1bc9b8dc3aa5380678c5a60593fb6abac68f (diff) | |
download | linux-95d92505b6063896d7a1e6fcadd07e8552653cfb.tar.gz linux-95d92505b6063896d7a1e6fcadd07e8552653cfb.tar.bz2 linux-95d92505b6063896d7a1e6fcadd07e8552653cfb.zip |
mac802154: Only allow PAN controllers to process association requests
It is not very clear in the specification whether simple coordinators
are allowed or not to answer to association requests themselves. As
there is no synchronization mechanism, it is probably best to rely on
the relay feature of these coordinators and avoid processing them in
this case.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/linux-wpan/20231128111655.507479-4-miquel.raynal@bootlin.com
Diffstat (limited to 'net/mac802154')
-rw-r--r-- | net/mac802154/scan.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c index 5873da634fb4..1c0eeaa76560 100644 --- a/net/mac802154/scan.c +++ b/net/mac802154/scan.c @@ -781,6 +781,12 @@ int mac802154_process_association_req(struct ieee802154_sub_if_data *sdata, unlikely(dest->short_addr != wpan_dev->short_addr)) return -ENODEV; + if (wpan_dev->parent) { + dev_dbg(&sdata->dev->dev, + "Ignoring ASSOC REQ, not the PAN coordinator\n"); + return -ENODEV; + } + mutex_lock(&wpan_dev->association_lock); memcpy(&assoc_req_pl, skb->data, sizeof(assoc_req_pl)); |