mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
tcp: avoid two atomic ops for syncookies
inet_reqsk_alloc() is used to allocate a temporary request in order to generate a SYNACK with a cookie. Then later, syncookie validation also uses a temporary request. These paths already took a reference on listener refcount, we can avoid a couple of atomic operations. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
004a5d0140
commit
a1a5344ddb
7 changed files with 19 additions and 11 deletions
|
|
@ -595,7 +595,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
|
|||
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
|
||||
goto drop;
|
||||
|
||||
req = inet_reqsk_alloc(&dccp_request_sock_ops, sk);
|
||||
req = inet_reqsk_alloc(&dccp_request_sock_ops, sk, true);
|
||||
if (req == NULL)
|
||||
goto drop;
|
||||
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
|
|||
if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
|
||||
goto drop;
|
||||
|
||||
req = inet_reqsk_alloc(&dccp6_request_sock_ops, sk);
|
||||
req = inet_reqsk_alloc(&dccp6_request_sock_ops, sk, true);
|
||||
if (req == NULL)
|
||||
goto drop;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue