summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLifeng Sun <lifongsun@gmail.com>2011-04-27 22:04:51 +0000
committerDavid S. Miller <davem@davemloft.net>2011-05-02 15:41:29 -0700
commit41c31f318a5209922d051e293c61e4724daad11c (patch)
tree23e17b3010423fcc721e524bd9a559703063191f
parent983960b159a75621855283030d92a80bea92e071 (diff)
downloadop-kernel-dev-41c31f318a5209922d051e293c61e4724daad11c.zip
op-kernel-dev-41c31f318a5209922d051e293c61e4724daad11c.tar.gz
networking: inappropriate ioctl operation should return ENOTTY
ioctl() calls against a socket with an inappropriate ioctl operation are incorrectly returning EINVAL rather than ENOTTY: [ENOTTY] Inappropriate I/O control operation. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=33992 Signed-off-by: Lifeng Sun <lifongsun@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index c2ac599..856b6ee 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4773,7 +4773,7 @@ static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cm
* is never reached
*/
WARN_ON(1);
- err = -EINVAL;
+ err = -ENOTTY;
break;
}
@@ -5041,7 +5041,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
/* Set the per device memory buffer space.
* Not applicable in our case */
case SIOCSIFLINK:
- return -EINVAL;
+ return -ENOTTY;
/*
* Unknown or private ioctl.
@@ -5062,7 +5062,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
/* Take care of Wireless Extensions */
if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST)
return wext_handle_ioctl(net, &ifr, cmd, arg);
- return -EINVAL;
+ return -ENOTTY;
}
}
OpenPOWER on IntegriCloud