aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLifeng Sun <lifongsun@gmail.com>2011-04-27 18:04:51 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-02 18:41:29 -0400
commit41c31f318a5209922d051e293c61e4724daad11c (patch)
tree23e17b3010423fcc721e524bd9a559703063191f /net
parent983960b159a75621855283030d92a80bea92e071 (diff)
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>
Diffstat (limited to '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 c2ac599fa0f6..856b6ee9a1d5 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
4773 * is never reached 4773 * is never reached
4774 */ 4774 */
4775 WARN_ON(1); 4775 WARN_ON(1);
4776 err = -EINVAL; 4776 err = -ENOTTY;
4777 break; 4777 break;
4778 4778
4779 } 4779 }
@@ -5041,7 +5041,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
5041 /* Set the per device memory buffer space. 5041 /* Set the per device memory buffer space.
5042 * Not applicable in our case */ 5042 * Not applicable in our case */
5043 case SIOCSIFLINK: 5043 case SIOCSIFLINK:
5044 return -EINVAL; 5044 return -ENOTTY;
5045 5045
5046 /* 5046 /*
5047 * Unknown or private ioctl. 5047 * Unknown or private ioctl.
@@ -5062,7 +5062,7 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
5062 /* Take care of Wireless Extensions */ 5062 /* Take care of Wireless Extensions */
5063 if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) 5063 if (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST)
5064 return wext_handle_ioctl(net, &ifr, cmd, arg); 5064 return wext_handle_ioctl(net, &ifr, cmd, arg);
5065 return -EINVAL; 5065 return -ENOTTY;
5066 } 5066 }
5067} 5067}
5068 5068