l2tp: use skb_queue_purge in l2tp_ip_destroy_sock
Subsystems (3)
PATCH v4 1/1 l2tp: use skb_queue_purge in l2tp_ip_destroy_sock
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.
Also unexport ip_flush_pending_frames since it was originally exported in commit 4ff8863419cd ("ipv4: export ip_flush_pending_frames") for l2tp and is not used by other modules.
---
v4:
- use __skb_queue_purge (eric)
v3: https://lore.kernel.org/netdev/[email protected]/
- put signoff above change history
v2: https://lore.kernel.org/all/[email protected]/
- also unexport ip_flush_pending_frames (cong)
v1: https://lore.kernel.org/all/[email protected]/
--- net/ipv4/ip_output.c | 1 - net/l2tp/l2tp_ip.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-)
net/ipv4/ip_output.c +0 -1
@@ -1534,7 +1534,6 @@ void ip_flush_pending_frames(struct sock *sk) {__ip_flush_pending_frames (sk, &sk->sk_write_queue, &inet_sk (sk)->cork.base); } -EXPORT_SYMBOL_GPL (ip_flush_pending_frames); struct sk_buff *ip_make_skb(struct sock *sk, struct flowi4 *fl4,
net/l2tp/l2tp_ip.c +1 -3
@@ -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) {
Signature · 1 line
2.34.1
Quoted 10 lines · James Chapman
Recent commit
ed8ebee6def7("l2tp: havel2tp_ip_destroy_sockuseip_flush_pending_frames") was incorrect in thatl2tp_ipdoes not use socket cork andip_flush_pending_framesis for sockets that do. Use__skb_queue_purgeinstead and remove the unnecessary lock.Also unexport
ip_flush_pending_framessince it was originally exported in commit4ff8863419cd("ipv4: exportip_flush_pending_frames") for l2tp and is not used by other modules.
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 19 Aug 2024 15:33:33 +0100 you wrote:
Recent commit
ed8ebee6def7("l2tp: havel2tp_ip_destroy_sockuseip_flush_pending_frames") was incorrect in thatl2tp_ipdoes not use socket cork andip_flush_pending_framesis for sockets that do. Use__skb_queue_purgeinstead and remove the unnecessary lock.Also unexport
ip_flush_pending_framessince it was originally exported in commit4ff8863419cd("ipv4: exportip_flush_pending_frames") for l2tp and is not used by other modules.[...]
Here is the summary with links:
- [net-next,v4] l2tp: use skb_queue_purge in l2tp_ip_destroy_sock
https://git.kernel.org/netdev/net-next/c/bc3dd9ed04d6
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html