af_llc.c (681e4a5e13c1c8315694eb4f44e0cdd84c9082d2) af_llc.c (e87cc4728f0e2fb663e592a1141742b1d6c63256)
1/*
2 * af_llc.c - LLC User Interface SAPs
3 * Description:
4 * Functions in this module are implementation of socket based llc
5 * communications for the Linux operating system. Support of llc class
6 * one and class two is provided via SOCK_DGRAM and SOCK_STREAM
7 * respectively.
8 *

--- 504 unchanged lines hidden (view full) ---

513 goto out;
514 rc = -EOPNOTSUPP;
515 if (unlikely(sk->sk_type != SOCK_STREAM))
516 goto out;
517 rc = -EAGAIN;
518 if (sock_flag(sk, SOCK_ZAPPED))
519 goto out;
520 rc = 0;
1/*
2 * af_llc.c - LLC User Interface SAPs
3 * Description:
4 * Functions in this module are implementation of socket based llc
5 * communications for the Linux operating system. Support of llc class
6 * one and class two is provided via SOCK_DGRAM and SOCK_STREAM
7 * respectively.
8 *

--- 504 unchanged lines hidden (view full) ---

513 goto out;
514 rc = -EOPNOTSUPP;
515 if (unlikely(sk->sk_type != SOCK_STREAM))
516 goto out;
517 rc = -EAGAIN;
518 if (sock_flag(sk, SOCK_ZAPPED))
519 goto out;
520 rc = 0;
521 if (!(unsigned)backlog) /* BSDism */
521 if (!(unsigned int)backlog) /* BSDism */
522 backlog = 1;
523 sk->sk_max_ack_backlog = backlog;
524 if (sk->sk_state != TCP_LISTEN) {
525 sk->sk_ack_backlog = 0;
526 sk->sk_state = TCP_LISTEN;
527 }
528 sk->sk_socket->flags |= __SO_ACCEPTCON;
529out:

--- 271 unchanged lines hidden (view full) ---

801
802 if (copied >= target) { /* Do not sleep, just process backlog. */
803 release_sock(sk);
804 lock_sock(sk);
805 } else
806 sk_wait_data(sk, &timeo);
807
808 if ((flags & MSG_PEEK) && peek_seq != llc->copied_seq) {
522 backlog = 1;
523 sk->sk_max_ack_backlog = backlog;
524 if (sk->sk_state != TCP_LISTEN) {
525 sk->sk_ack_backlog = 0;
526 sk->sk_state = TCP_LISTEN;
527 }
528 sk->sk_socket->flags |= __SO_ACCEPTCON;
529out:

--- 271 unchanged lines hidden (view full) ---

801
802 if (copied >= target) { /* Do not sleep, just process backlog. */
803 release_sock(sk);
804 lock_sock(sk);
805 } else
806 sk_wait_data(sk, &timeo);
807
808 if ((flags & MSG_PEEK) && peek_seq != llc->copied_seq) {
809 if (net_ratelimit())
810 printk(KERN_DEBUG "LLC(%s:%d): Application "
811 "bug, race in MSG_PEEK.\n",
812 current->comm, task_pid_nr(current));
809 net_dbg_ratelimited("LLC(%s:%d): Application bug, race in MSG_PEEK\n",
810 current->comm,
811 task_pid_nr(current));
813 peek_seq = llc->copied_seq;
814 }
815 continue;
816 found_ok_skb:
817 /* Ok so how much can we use? */
818 used = skb->len - offset;
819 if (len < used)
820 used = len;

--- 433 unchanged lines hidden ---
812 peek_seq = llc->copied_seq;
813 }
814 continue;
815 found_ok_skb:
816 /* Ok so how much can we use? */
817 used = skb->len - offset;
818 if (len < used)
819 used = len;

--- 433 unchanged lines hidden ---