summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-09-02 23:57:18 +0000
committerDavid S. Miller <davem@davemloft.net>2012-09-03 13:22:43 -0400
commite812347ccf9e8ce073b0ba0c49d03b124707b2b4 (patch)
treefc5602c3712ca9da46ceba4bb52143c07f77cebd /net
parent5b716ac728bcc01b1f2a7ed6e437196602237c27 (diff)
net: sock_edemux() should take care of timewait sockets
sock_edemux() can handle either a regular socket or a timewait socket Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/sock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 8f67ced8d6a8..7f64467535d1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1523,7 +1523,12 @@ EXPORT_SYMBOL(sock_rfree);
void sock_edemux(struct sk_buff *skb)
{
- sock_put(skb->sk);
+ struct sock *sk = skb->sk;
+
+ if (sk->sk_state == TCP_TIME_WAIT)
+ inet_twsk_put(inet_twsk(sk));
+ else
+ sock_put(sk);
}
EXPORT_SYMBOL(sock_edemux);