Skip to contentSkip to conversation

kni: return failure for all ioctls

PATCH Applied Dan Gora 3 participants 3 messages Sep 13, 2018 – Oct 2, 2018

lore
Share & tools
lore

Dan Gora

author
#0 lore raw

PATCH 1/1 kni: return failure for all ioctls

Modify kni_net_ioctl() to return -EOPNOTSUPP for all ioctls instead of 0.

This is necessary because the Wicked (and possibly other) network interface managers will perform the SIOCGIWNAME ioctl to check if the interface is a wireless interface. If the KNI module returns success, Wicked will incorrectly interpret the interface as a wireless interface.

---
 kernel/linux/kni/kni_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/linux/kni/kni_net.c +1 -1
index fea3ec7e7..f94f2abaf 100644
@@ -600,7 +600,7 @@ kni_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 	pr_debug("kni_net_ioctl group:%d cmd:%d\n",
 		((struct kni_dev *)netdev_priv(dev))->group_id, cmd);
 
-	return 0;
+	return -EOPNOTSUPP;
 }
 
 static void
Signature · 1 line
2.19.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Dan Gora

Modify kni_net_ioctl() to return -EOPNOTSUPP for all ioctls instead of 0.

This is necessary because the Wicked (and possibly other) network interface managers will perform the SIOCGIWNAME ioctl to check if the interface is a wireless interface. If the KNI module returns success, Wicked will incorrectly interpret the interface as a wireless interface.

#2 lore raw

18/09/2018 18:19, Ferruh Yigit:

Quoted 10 lines · Dan Gora
Quoted 9 lines

Modify kni_net_ioctl() to return -EOPNOTSUPP for all ioctls instead of 0.

This is necessary because the Wicked (and possibly other) network interface managers will perform the SIOCGIWNAME ioctl to check if the interface is a wireless interface. If the KNI module returns success, Wicked will incorrectly interpret the interface as a wireless interface.

Quoted 3 lines
Quoted 1 line

Applied, thanks