Thread (3 messages) flat view 3 messages, 3 authors, 3d ago
WARM3d

[PATCH] bonding: reject IEEE 802.15.4 devices in bond_enslave

From: Jiale Yao <hidden>
Date: 2026-08-31 14:08:12
Also in: lkml
Subsystem: bonding driver, networking drivers, the rest · Maintainers: Jay Vosburgh, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Bonding already refuses CAN devices because their protocol-specific state
is incompatible with the bonding model. IEEE 802.15.4 devices have the
same constraint: they keep protocol-specific state in
dev->ieee802154_ptr and do not use Ethernet link-layer semantics.

Extend the existing check to reject ARPHRD_IEEE802154 and
ARPHRD_IEEE802154_MONITOR devices before bonding changes their link-layer
settings.

Link: https://lore.kernel.org/netdev/aohMHTTH4VqqgZA7@fedora/ (local)
Link: https://lore.kernel.org/netdev/6001bd73-ef68-4820-8371-a22775fb820a@hartkopp.net/ (local)
Fixes: d5ae67bacd96 ("ieee802154: rework interface registration")
Suggested-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Jiale Yao <redacted>
---
 drivers/net/bonding/bond_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 522eab060f9e..c716336c5172 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1894,9 +1894,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
 	struct sockaddr_storage ss;
 	int res = 0, i;
 
-	if (slave_dev->type == ARPHRD_CAN) {
+	if (slave_dev->type == ARPHRD_CAN ||
+	    slave_dev->type == ARPHRD_IEEE802154 ||
+	    slave_dev->type == ARPHRD_IEEE802154_MONITOR) {
 		BOND_NL_ERR(bond_dev, extack,
-			    "CAN devices cannot be enslaved");
+			    "CAN and IEEE 802.15.4 devices cannot be enslaved");
 		return -EPERM;
 	}
 
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help