Skip to content

Commit

Permalink
net: sock_edemux() should take care of timewait sockets
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 3, 2012
1 parent 5b716ac commit e812347
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e812347

Please sign in to comment.