On 09/03/2018 10:31 PM, Ttttabcd wrote:
> Hello everyone,recently I am looking at the source code for handling TCP 
> three-way handshake(Linux Kernel version 4.18.5).
> 
> I found some strange places in the source code for handling syn messages.
> 
> in the function "tcp_conn_request"
> 
> This code will be executed when we don't enable the syn cookies.
> 
>               if (!net->ipv4.sysctl_tcp_syncookies &&
>                   (net->ipv4.sysctl_max_syn_backlog - 
> inet_csk_reqsk_queue_len(sk) <
>                    (net->ipv4.sysctl_max_syn_backlog >> 2)) &&
>                   !tcp_peer_is_proven(req, dst)) {
>                       /* Without syncookies last quarter of
>                        * backlog is filled with destinations,
>                        * proven to be alive.
>                        * It means that we continue to communicate
>                        * to destinations, already remembered
>                        * to the moment of synflood.
>                        */
>                       pr_drop_req(req, ntohs(tcp_hdr(skb)->source),
>                                   rsk_ops->family);
>                       goto drop_and_release;
>               }
> 
> But why don't we use all the syn queues?


Isn't it explained in the comment ?

Anyway, I am not sure anyone disables syn cookies.

Reply via email to