aboutsummaryrefslogtreecommitdiffstats
path: root/net/llc
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-05-25 18:08:59 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-18 00:26:02 -0400
commit29efcd2666b3a465b40aa07ef1f4d79847303e2f (patch)
tree6d1b3bb6543a24a6aa1a319adea20fbcea7b930a /net/llc
parentaecbd4e45c2e469e0452ffb2c0b0d881e2815bb8 (diff)
[LLC]: allow datagram recvmsg
LLC receive is broken for SOCK_DGRAM. If an application does recv() on a datagram socket and there is no data present, don't return "not connected". Instead, just do normal datagram semantics. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc')
-rw-r--r--net/llc/af_llc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 7465170a36ca..75c9b1480801 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -674,7 +674,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
674 674
675 lock_sock(sk); 675 lock_sock(sk);
676 copied = -ENOTCONN; 676 copied = -ENOTCONN;
677 if (sk->sk_state == TCP_LISTEN) 677 if (unlikely(sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_LISTEN))
678 goto out; 678 goto out;
679 679
680 timeo = sock_rcvtimeo(sk, nonblock); 680 timeo = sock_rcvtimeo(sk, nonblock);
@@ -733,7 +733,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
733 if (sk->sk_shutdown & RCV_SHUTDOWN) 733 if (sk->sk_shutdown & RCV_SHUTDOWN)
734 break; 734 break;
735 735
736 if (sk->sk_state == TCP_CLOSE) { 736 if (sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_CLOSE) {
737 if (!sock_flag(sk, SOCK_DONE)) { 737 if (!sock_flag(sk, SOCK_DONE)) {
738 /* 738 /*
739 * This occurs when user tries to read 739 * This occurs when user tries to read