[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220617193254.1275912-3-miquel.raynal@bootlin.com>
Date: Fri, 17 Jun 2022 21:32:50 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Alexander Aring <alex.aring@...il.com>,
Stefan Schmidt <stefan@...enfreihafen.org>,
linux-wpan@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
David Girault <david.girault@...vo.com>,
Romuald Despres <romuald.despres@...vo.com>,
Frederic Blain <frederic.blain@...vo.com>,
Nicolas Schodet <nico@...fr.eu.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Miquel Raynal <miquel.raynal@...tlin.com>
Subject: [PATCH wpan-next v2 2/6] net: ieee802154: Ensure only FFDs can become PAN coordinators
This is a limitation clearly listed in the specification. Now that we
have device types,let's ensure that only FFDs can become PAN
coordinators.
Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
---
net/ieee802154/nl802154.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 638bf544f102..0c6fc3385320 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -924,6 +924,9 @@ static int nl802154_new_interface(struct sk_buff *skb, struct genl_info *info)
return -EINVAL;
}
+ if (type == NL802154_IFTYPE_COORD && !cfg802154_is_ffd(rdev))
+ return -EINVAL;
+
if (info->attrs[NL802154_ATTR_EXTENDED_ADDR])
extended_addr = nla_get_le64(info->attrs[NL802154_ATTR_EXTENDED_ADDR]);
--
2.34.1
Powered by blists - more mailing lists