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 <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
004a5d0140
commit
a1a5344ddb
@@ -170,7 +170,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
|
||||
goto out;
|
||||
|
||||
ret = NULL;
|
||||
req = inet_reqsk_alloc(&tcp6_request_sock_ops, sk);
|
||||
req = inet_reqsk_alloc(&tcp6_request_sock_ops, sk, false);
|
||||
if (!req)
|
||||
goto out;
|
||||
|
||||
|
Reference in New Issue
Block a user