tcp_minisocks.c (1cbc99dfe5d7d686fd022647f4e489b5eb8e9068) | tcp_minisocks.c (90bbcc608369a1b46089b0f5aa22b8ea31ffa12e) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Authors: Ross Biro --- 531 unchanged lines hidden (view full) --- 540 newicsk->icsk_ack.last_seg_size = skb->len - newtp->tcp_header_len; 541 newtp->rx_opt.mss_clamp = req->mss; 542 tcp_ecn_openreq_child(newtp, req); 543 newtp->fastopen_rsk = NULL; 544 newtp->syn_data_acked = 0; 545 newtp->rack.mstamp.v64 = 0; 546 newtp->rack.advanced = 0; 547 | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Authors: Ross Biro --- 531 unchanged lines hidden (view full) --- 540 newicsk->icsk_ack.last_seg_size = skb->len - newtp->tcp_header_len; 541 newtp->rx_opt.mss_clamp = req->mss; 542 tcp_ecn_openreq_child(newtp, req); 543 newtp->fastopen_rsk = NULL; 544 newtp->syn_data_acked = 0; 545 newtp->rack.mstamp.v64 = 0; 546 newtp->rack.advanced = 0; 547 |
548 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_PASSIVEOPENS); | 548 __TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS); |
549 } 550 return newsk; 551} 552EXPORT_SYMBOL(tcp_create_openreq_child); 553 554/* 555 * Process an incoming packet for SYN_RECV sockets represented as a 556 * request_sock. Normally sk is the listener socket but for TFO it --- 142 unchanged lines hidden (view full) --- 699 * should cause reset in unsynchronized states. 700 */ 701 702 /* RFC793: "first check sequence number". */ 703 704 if (paws_reject || !tcp_in_window(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq, 705 tcp_rsk(req)->rcv_nxt, tcp_rsk(req)->rcv_nxt + req->rsk_rcv_wnd)) { 706 /* Out of window: send ACK and drop. */ | 549 } 550 return newsk; 551} 552EXPORT_SYMBOL(tcp_create_openreq_child); 553 554/* 555 * Process an incoming packet for SYN_RECV sockets represented as a 556 * request_sock. Normally sk is the listener socket but for TFO it --- 142 unchanged lines hidden (view full) --- 699 * should cause reset in unsynchronized states. 700 */ 701 702 /* RFC793: "first check sequence number". */ 703 704 if (paws_reject || !tcp_in_window(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq, 705 tcp_rsk(req)->rcv_nxt, tcp_rsk(req)->rcv_nxt + req->rsk_rcv_wnd)) { 706 /* Out of window: send ACK and drop. */ |
707 if (!(flg & TCP_FLAG_RST)) | 707 if (!(flg & TCP_FLAG_RST) && 708 !tcp_oow_rate_limited(sock_net(sk), skb, 709 LINUX_MIB_TCPACKSKIPPEDSYNRECV, 710 &tcp_rsk(req)->last_oow_ack_time)) |
708 req->rsk_ops->send_ack(sk, skb, req); 709 if (paws_reject) 710 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSESTABREJECTED); 711 return NULL; 712 } 713 714 /* In sequence, PAWS is OK. */ 715 --- 5 unchanged lines hidden (view full) --- 721 at tcp_rsk(req)->rcv_isn + 1. */ 722 flg &= ~TCP_FLAG_SYN; 723 } 724 725 /* RFC793: "second check the RST bit" and 726 * "fourth, check the SYN bit" 727 */ 728 if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) { | 711 req->rsk_ops->send_ack(sk, skb, req); 712 if (paws_reject) 713 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_PAWSESTABREJECTED); 714 return NULL; 715 } 716 717 /* In sequence, PAWS is OK. */ 718 --- 5 unchanged lines hidden (view full) --- 724 at tcp_rsk(req)->rcv_isn + 1. */ 725 flg &= ~TCP_FLAG_SYN; 726 } 727 728 /* RFC793: "second check the RST bit" and 729 * "fourth, check the SYN bit" 730 */ 731 if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) { |
729 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_ATTEMPTFAILS); | 732 __TCP_INC_STATS(sock_net(sk), TCP_MIB_ATTEMPTFAILS); |
730 goto embryonic_reset; 731 } 732 733 /* ACK sequence verified above, just make sure ACK is 734 * set. If ACK not set, just silently drop the packet. 735 * 736 * XXX (TFO) - if we ever allow "data after SYN", the 737 * following check needs to be removed. --- 96 unchanged lines hidden --- | 733 goto embryonic_reset; 734 } 735 736 /* ACK sequence verified above, just make sure ACK is 737 * set. If ACK not set, just silently drop the packet. 738 * 739 * XXX (TFO) - if we ever allow "data after SYN", the 740 * following check needs to be removed. --- 96 unchanged lines hidden --- |