projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8789793
)
tun: return proper error code from tun_do_read
author
Alex Gartrell
<agartrell@fb.com>
Fri, 26 Dec 2014 07:22:49 +0000
(23:22 -0800)
committer
David S. Miller
<davem@davemloft.net>
Wed, 31 Dec 2014 19:14:54 +0000
(14:14 -0500)
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>
drivers/net/tun.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/net/tun.c
b/drivers/net/tun.c
index df5e948718447f7dfd2631574feca959103807fe..c0df872f5b8c53818ca7b7c130f1fcb0fb972e89 100644
(file)
--- a/
drivers/net/tun.c
+++ b/
drivers/net/tun.c
@@
-1380,7
+1380,7
@@
static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile,
skb = __skb_recv_datagram(tfile->socket.sk, noblock ? MSG_DONTWAIT : 0,
&peeked, &off, &err);
if (!skb)
- return
0
;
+ return
err
;
ret = tun_put_user(tun, tfile, skb, to);
if (unlikely(ret < 0))