Skip to content
Commit 04c494e6 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

Revert "tcp/dccp: get rid of inet_twsk_purge()"

This reverts commits:

0dad4087 ("tcp/dccp: get rid of inet_twsk_purge()")
d507204d ("tcp/dccp: add tw->tw_bslot")

As Leonard pointed out, a newly allocated netns can happen
to reuse a freed 'struct net'.

While TCP TW timers were covered by my patches, other things were not:

1) Lookups in rx path (INET_MATCH() and INET6_MATCH()), as they look
  at 4-tuple plus the 'struct net' pointer.

2) /proc/net/tcp[6] and inet_diag, same reason.

3) hashinfo->bhash[], same reason.

Fixing all this seems risky, lets instead revert.

In the future, we might have a per netns tcp hash table, or
a per netns list of timewait sockets...

Fixes: 0dad4087

 ("tcp/dccp: get rid of inet_twsk_purge()")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarLeonard Crestez <cdleonard@gmail.com>
Tested-by: default avatarLeonard Crestez <cdleonard@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9646ee44
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment