}
/**
- * discard_rx_queue - discard all buffers in socket receive queue
- *
- * Caller must hold socket lock
- */
-static void discard_rx_queue(struct sock *sk)
-{
- struct sk_buff *buf;
-
- while ((buf = __skb_dequeue(&sk->sk_receive_queue)))
- kfree_skb(buf);
-}
-
-/**
* reject_rx_queue - reject all buffers in socket receive queue
*
* Caller must hold socket lock
res = tipc_deleteport(tport->ref);
/* Discard any remaining (connection-based) messages in receive queue */
- discard_rx_queue(sk);
+ __skb_queue_purge(&sk->sk_receive_queue);
/* Reject any messages that accumulated in backlog queue */
sock->state = SS_DISCONNECTING;
case SS_DISCONNECTING:
/* Discard any unreceived messages */
- discard_rx_queue(sk);
+ __skb_queue_purge(&sk->sk_receive_queue);
/* Wake up anyone sleeping in poll */
sk->sk_state_change(sk);