Commit ed8ebee6 authored by James Chapman's avatar James Chapman Committed by David S. Miller

l2tp: have l2tp_ip_destroy_sock use ip_flush_pending_frames

Use the recently exported ip_flush_pending_frames instead of a
free-coded version and lock the socket while we call it.
Signed-off-by: default avatarJames Chapman <jchapman@katalix.com>
Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4ff88634
...@@ -236,10 +236,10 @@ static void l2tp_ip_close(struct sock *sk, long timeout) ...@@ -236,10 +236,10 @@ static void l2tp_ip_close(struct sock *sk, long timeout)
static void l2tp_ip_destroy_sock(struct sock *sk) static void l2tp_ip_destroy_sock(struct sock *sk)
{ {
struct l2tp_tunnel *tunnel; struct l2tp_tunnel *tunnel;
struct sk_buff *skb;
while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) lock_sock(sk);
kfree_skb(skb); ip_flush_pending_frames(sk);
release_sock(sk);
tunnel = l2tp_sk_to_tunnel(sk); tunnel = l2tp_sk_to_tunnel(sk);
if (tunnel) { if (tunnel) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment