X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=net%2Fllc%2Faf_llc.c;h=2652ead96c64e329b7c2f929316d1324d8aecfd5;hb=aa43f77939c97bf9d3580c6a5e71a5a40290e451;hp=75c9b1480801e2a52cc81ac96fbcfe21cbcc918e;hpb=4c1234ff24dd8dc2d9020d6315d91a71339be114;p=mv-sheeva.git diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 75c9b148080..2652ead96c6 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c @@ -20,7 +20,6 @@ * * See the GNU General Public License for more details. */ -#include #include #include #include @@ -785,24 +784,20 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, copied += used; len -= used; - if (used + offset < skb->len) - continue; - if (!(flags & MSG_PEEK)) { sk_eat_skb(sk, skb, 0); *seq = 0; } + + /* For non stream protcols we get one packet per recvmsg call */ + if (sk->sk_type != SOCK_STREAM) + goto copy_uaddr; + + /* Partial read */ + if (used + offset < skb->len) + continue; } while (len > 0); - /* - * According to UNIX98, msg_name/msg_namelen are ignored - * on connected socket. -ANK - * But... af_llc still doesn't have separate sets of methods for - * SOCK_DGRAM and SOCK_STREAM :-( So we have to do this test, will - * eventually fix this tho :-) -acme - */ - if (sk->sk_type == SOCK_DGRAM) - goto copy_uaddr; out: release_sock(sk); return copied;