1
0
Fork 0

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>
hifive-unleashed-5.1
Eric Dumazet 2012-09-02 23:57:18 +00:00 committed by David S. Miller
parent 5b716ac728
commit e812347ccf
1 changed files with 6 additions and 1 deletions

View File

@ -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);