Re: [PATCH v2 net] tcp: md5: incorrect tcp_header_len for incoming connections

From: Francesco Ruggeri
Date: Mon Apr 25 2022 - 13:56:13 EST


On Sun, Apr 24, 2022 at 12:37 PM Eric Dumazet <edumazet@xxxxxxxxxx> wrote:
>
> Wait a minute.
>
> Are you sure treq->af_specific is initialized at this point ?
>
> I should have tested this one liner patch really :/
>
> I think that for syncookies, treq->af_specific is not initialized,
> because we do not go through
> tcp_conn_request() helper, but instead use cookie_tcp_reqsk_alloc()
>
> Before your patch treq->af_specific was only used during SYNACK
> generation, which does not happen in syncookie more while receiving
> the third packet.
>
> I will test something like this patch. We could move the init after
> cookie_tcp_reqsk_alloc() has been called, but I prefer using the same
> construct than tcp_conn_request()
>

Thanks for fixing this Eric. I had not considered syncookies.

Francesco