kni: return failure for all ioctls

Message ID 20180913214652.20771-1-dg@adax.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series kni: return failure for all ioctls |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Dan Gora Sept. 13, 2018, 9:46 p.m. UTC
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.

Signed-off-by: Dan Gora <dg@adax.com>
---
 kernel/linux/kni/kni_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit Sept. 18, 2018, 4:19 p.m. UTC | #1
On 9/13/2018 10:46 PM, Dan Gora wrote:
> 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.
> 
> Signed-off-by: Dan Gora <dg@adax.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon Oct. 2, 2018, 3:55 p.m. UTC | #2
18/09/2018 18:19, Ferruh Yigit:
> On 9/13/2018 10:46 PM, Dan Gora wrote:
> > 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.
> > 
> > Signed-off-by: Dan Gora <dg@adax.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks
  

Patch

diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index fea3ec7e7..f94f2abaf 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -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