mirror of https://gitee.com/openkylin/linux.git
net: do not call sock_put() on TIMEWAIT sockets
commit 3ab5aee7fe
("net: Convert TCP & DCCP hash tables to use RCU /
hlist_nulls") incorrectly used sock_put() on TIMEWAIT sockets.
We should instead use inet_twsk_put()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
28ad7b06f4
commit
80ad1d61e7
|
@ -287,7 +287,7 @@ struct sock *__inet_lookup_established(struct net *net,
|
||||||
if (unlikely(!INET_TW_MATCH(sk, net, acookie,
|
if (unlikely(!INET_TW_MATCH(sk, net, acookie,
|
||||||
saddr, daddr, ports,
|
saddr, daddr, ports,
|
||||||
dif))) {
|
dif))) {
|
||||||
sock_put(sk);
|
inet_twsk_put(inet_twsk(sk));
|
||||||
goto begintw;
|
goto begintw;
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -116,7 +116,7 @@ struct sock *__inet6_lookup_established(struct net *net,
|
||||||
}
|
}
|
||||||
if (unlikely(!INET6_TW_MATCH(sk, net, saddr, daddr,
|
if (unlikely(!INET6_TW_MATCH(sk, net, saddr, daddr,
|
||||||
ports, dif))) {
|
ports, dif))) {
|
||||||
sock_put(sk);
|
inet_twsk_put(inet_twsk(sk));
|
||||||
goto begintw;
|
goto begintw;
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in New Issue