]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tun: return proper error code from tun_do_read
authorAlex Gartrell <agartrell@fb.com>
Fri, 26 Dec 2014 07:22:49 +0000 (23:22 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2015 08:23:41 +0000 (10:23 +0200)
commit6e24551ff94701e62c13c982eca0bc3a682817ad
tree1029893bbf61e0a178e0a880b3e483fdc5c6559b
parent553ecf745589a74d4195e6019a026c15b5048c58
tun: return proper error code from tun_do_read

[ Upstream commit 957f094f221f81e457133b1f4c4d95ffa49ff731 ]

Instead of -1 with EAGAIN, read on a O_NONBLOCK tun fd will return 0.  This
fixes this by properly returning the error code from __skb_recv_datagram.

Signed-off-by: Alex Gartrell <agartrell@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/tun.c