tcp.c (e0d694d638dba768b47be31c22e1a9b4f862f561) tcp.c (d9b55bf7b6788ec0bd1db1acefbc4feb1399144a)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * Implementation of the Transmission Control Protocol(TCP).
8 *

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

541 if (sk->sk_shutdown & RCV_SHUTDOWN)
542 mask |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
543
544 /* Connected or passive Fast Open socket? */
545 if (state != TCP_SYN_SENT &&
546 (state != TCP_SYN_RECV || rcu_access_pointer(tp->fastopen_rsk))) {
547 int target = sock_rcvlowat(sk, 0, INT_MAX);
548
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * Implementation of the Transmission Control Protocol(TCP).
8 *

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

541 if (sk->sk_shutdown & RCV_SHUTDOWN)
542 mask |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
543
544 /* Connected or passive Fast Open socket? */
545 if (state != TCP_SYN_SENT &&
546 (state != TCP_SYN_RECV || rcu_access_pointer(tp->fastopen_rsk))) {
547 int target = sock_rcvlowat(sk, 0, INT_MAX);
548
549 if (tp->urg_seq == READ_ONCE(tp->copied_seq) &&
549 if (READ_ONCE(tp->urg_seq) == READ_ONCE(tp->copied_seq) &&
550 !sock_flag(sk, SOCK_URGINLINE) &&
551 tp->urg_data)
552 target++;
553
554 if (tcp_stream_is_readable(tp, target, sk))
555 mask |= EPOLLIN | EPOLLRDNORM;
556
557 if (!(sk->sk_shutdown & SEND_SHUTDOWN)) {

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

602 if (sk->sk_state == TCP_LISTEN)
603 return -EINVAL;
604
605 slow = lock_sock_fast(sk);
606 answ = tcp_inq(sk);
607 unlock_sock_fast(sk, slow);
608 break;
609 case SIOCATMARK:
550 !sock_flag(sk, SOCK_URGINLINE) &&
551 tp->urg_data)
552 target++;
553
554 if (tcp_stream_is_readable(tp, target, sk))
555 mask |= EPOLLIN | EPOLLRDNORM;
556
557 if (!(sk->sk_shutdown & SEND_SHUTDOWN)) {

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

602 if (sk->sk_state == TCP_LISTEN)
603 return -EINVAL;
604
605 slow = lock_sock_fast(sk);
606 answ = tcp_inq(sk);
607 unlock_sock_fast(sk, slow);
608 break;
609 case SIOCATMARK:
610 answ = tp->urg_data && tp->urg_seq == READ_ONCE(tp->copied_seq);
610 answ = tp->urg_data &&
611 READ_ONCE(tp->urg_seq) == READ_ONCE(tp->copied_seq);
611 break;
612 case SIOCOUTQ:
613 if (sk->sk_state == TCP_LISTEN)
614 return -EINVAL;
615
616 if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV))
617 answ = 0;
618 else

--- 3399 unchanged lines hidden ---
612 break;
613 case SIOCOUTQ:
614 if (sk->sk_state == TCP_LISTEN)
615 return -EINVAL;
616
617 if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV))
618 answ = 0;
619 else

--- 3399 unchanged lines hidden ---