Message ID | 20240813093914.501183-1-jchapman@katalix.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] l2tp: use skb_queue_purge in l2tp_ip_destroy_sock | expand |
On Tue, Aug 13, 2024 at 10:39:14AM +0100, James Chapman wrote: > Recent commit ed8ebee6def7 ("l2tp: have l2tp_ip_destroy_sock use > ip_flush_pending_frames") was incorrect in that l2tp_ip does not use > socket cork and ip_flush_pending_frames is for sockets that do. Use > skb_queue_purge instead and remove the unnecessary lock. > Please also unexport the symbol ip_flush_pending_frames(). Thanks.
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 39f3f1334c4a..ad659f4315df 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c @@ -258,9 +258,7 @@ static void l2tp_ip_destroy_sock(struct sock *sk) { struct l2tp_tunnel *tunnel; - lock_sock(sk); - ip_flush_pending_frames(sk); - release_sock(sk); + skb_queue_purge(&sk->sk_write_queue); tunnel = l2tp_sk_to_tunnel(sk); if (tunnel) {