From: Eric Dumazet Date: Sun, 2 Sep 2012 23:57:18 +0000 (+0000) Subject: net: sock_edemux() should take care of timewait sockets X-Git-Tag: upstream/snapshot3+hdmi~6711^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e812347ccf9e8ce073b0ba0c49d03b124707b2b4;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: David S. Miller --- diff --git a/net/core/sock.c b/net/core/sock.c index 8f67ced..7f64467 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);