summaryrefslogtreecommitdiff
path: root/net/llc/af_llc.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-05-25 22:08:59 (GMT)
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-18 04:26:02 (GMT)
commit29efcd2666b3a465b40aa07ef1f4d79847303e2f (patch)
tree6d1b3bb6543a24a6aa1a319adea20fbcea7b930a /net/llc/af_llc.c
parentaecbd4e45c2e469e0452ffb2c0b0d881e2815bb8 (diff)
downloadlinux-29efcd2666b3a465b40aa07ef1f4d79847303e2f.tar.xz
[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/af_llc.c')
-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 7465170..75c9b14 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,
lock_sock(sk);
copied = -ENOTCONN;
- if (sk->sk_state == TCP_LISTEN)
+ if (unlikely(sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_LISTEN))
goto out;
timeo = sock_rcvtimeo(sk, nonblock);
@@ -733,7 +733,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
if (sk->sk_shutdown & RCV_SHUTDOWN)
break;
- if (sk->sk_state == TCP_CLOSE) {
+ if (sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_CLOSE) {
if (!sock_flag(sk, SOCK_DONE)) {
/*
* This occurs when user tries to read