]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/llc/af_llc.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
[linux-2.6-omap-h63xx.git] / net / llc / af_llc.c
index 75c9b1480801e2a52cc81ac96fbcfe21cbcc918e..190bb3e051881fa1455f4456bff39e890ad0cc20 100644 (file)
@@ -20,7 +20,6 @@
  *
  * See the GNU General Public License for more details.
  */
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -65,7 +64,7 @@ static inline u16 llc_ui_next_link_no(int sap)
  *
  *     Given an ARP header type return the corresponding ethernet protocol.
  */
-static inline u16 llc_proto_type(u16 arphrd)
+static inline __be16 llc_proto_type(u16 arphrd)
 {
        return arphrd == ARPHRD_IEEE802_TR ?
                         htons(ETH_P_TR_802_2) : htons(ETH_P_802_2);
@@ -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;