Re: [PATCH] Applying inappropriate ioctl operation on socketshould return ENOTTY

From: Eric Dumazet
Date: Wed Apr 27 2011 - 01:59:02 EST


Le mercredi 27 avril 2011 Ã 13:37 +0800, Lifeng Sun a Ãcrit :
> 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
>
> This bug is not limited to socket, it also occurs in a lot of, maybe
> some hundred, other ioctl operations, while in the patch I only fixed
> about a dozen of additional ones in pipe, fifo and character device
> drivers.

Really ?

EINVAL is ok too : Request or argp is not valid.

I would say, its not a bug as you claim.

Its really too late to make such change and risk regressions.

isatty(fd) performs well. Please use it instead.

Also, networking patches should be sent to netdev@xxxxxxxxxxxxxxx and
David Miller, as mentioned in MAINTAINERS file.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/