Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
net: do not call sock_put() on TIMEWAIT sockets
Browse files Browse the repository at this point in the history
commit 3ab5aee ("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>
  • Loading branch information
Eric Dumazet authored and davem330 committed Oct 2, 2013
1 parent 28ad7b0 commit 80ad1d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/ipv4/inet_hashtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ struct sock *__inet_lookup_established(struct net *net,
if (unlikely(!INET_TW_MATCH(sk, net, acookie,
saddr, daddr, ports,
dif))) {
sock_put(sk);
inet_twsk_put(inet_twsk(sk));
goto begintw;
}
goto out;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/inet6_hashtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct sock *__inet6_lookup_established(struct net *net,
}
if (unlikely(!INET6_TW_MATCH(sk, net, saddr, daddr,
ports, dif))) {
sock_put(sk);
inet_twsk_put(inet_twsk(sk));
goto begintw;
}
goto out;
Expand Down

0 comments on commit 80ad1d6

Please sign in to comment.