* [PATCH] dev_ioctl should return -EINVAL for unknown ioctl instead of -ENOTTY
@ 2011-09-01 14:52 Wang Sheng-Hui
2011-09-01 15:41 ` Ben Hutchings
0 siblings, 1 reply; 3+ messages in thread
From: Wang Sheng-Hui @ 2011-09-01 14:52 UTC (permalink / raw)
To: davem, netdev, linux-kernel
The patch is against 3.1-rc3.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
net/core/dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 17d67b5..de6033c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5092,7 +5092,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 -ENOTTY;
+ return -EINVAL;
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dev_ioctl should return -EINVAL for unknown ioctl instead of -ENOTTY
2011-09-01 14:52 [PATCH] dev_ioctl should return -EINVAL for unknown ioctl instead of -ENOTTY Wang Sheng-Hui
@ 2011-09-01 15:41 ` Ben Hutchings
2011-09-01 22:00 ` Wang Sheng-Hui
0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2011-09-01 15:41 UTC (permalink / raw)
To: Wang Sheng-Hui; +Cc: davem, netdev, linux-kernel
On Thu, 2011-09-01 at 22:52 +0800, Wang Sheng-Hui wrote:
> The patch is against 3.1-rc3.
>
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
> ---
> net/core/dev.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 17d67b5..de6033c 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5092,7 +5092,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 -ENOTTY;
> + return -EINVAL;
> }
> }
>
Whereas, Linus Torvalds wrote in
<BANLkTin=PTbTwBR2s+owMLy+GmKigeoYvg@mail.gmail.com>:
[...]
> The correct error code for "I don't understand this ioctl" is ENOTTY.
> The naming may be odd, but you should think of that error value as a
> "unrecognized ioctl number, you're feeding me random numbers that I
> don't understand and I assume for historical reasons that you tried to
> do some tty operation on me".
[...]
(Not that we are consistent about using ENOTTY in networking now.)
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dev_ioctl should return -EINVAL for unknown ioctl instead of -ENOTTY
2011-09-01 15:41 ` Ben Hutchings
@ 2011-09-01 22:00 ` Wang Sheng-Hui
0 siblings, 0 replies; 3+ messages in thread
From: Wang Sheng-Hui @ 2011-09-01 22:00 UTC (permalink / raw)
To: Ben Hutchings; +Cc: davem, netdev, linux-kernel
On 2011年09月01日 23:41, Ben Hutchings wrote:
> On Thu, 2011-09-01 at 22:52 +0800, Wang Sheng-Hui wrote:
>> The patch is against 3.1-rc3.
>>
>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>> ---
>> net/core/dev.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 17d67b5..de6033c 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -5092,7 +5092,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 -ENOTTY;
>> + return -EINVAL;
>> }
>> }
>>
>
> Whereas, Linus Torvalds wrote in
> <BANLkTin=PTbTwBR2s+owMLy+GmKigeoYvg@mail.gmail.com>:
> [...]
>> The correct error code for "I don't understand this ioctl" is ENOTTY.
>> The naming may be odd, but you should think of that error value as a
>> "unrecognized ioctl number, you're feeding me random numbers that I
>> don't understand and I assume for historical reasons that you tried to
>> do some tty operation on me".
> [...]
>
> (Not that we are consistent about using ENOTTY in networking now.)
>
> Ben.
>
Got it. Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-01 22:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-01 14:52 [PATCH] dev_ioctl should return -EINVAL for unknown ioctl instead of -ENOTTY Wang Sheng-Hui
2011-09-01 15:41 ` Ben Hutchings
2011-09-01 22:00 ` Wang Sheng-Hui
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.