Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipv6: mcast: Simplify mld_clear_{report|query}()

Use __skb_queue_purge() instead of re-implementing it. Note that it uses
kfree_skb_reason() instead of kfree_skb() internally, and pass
SKB_DROP_REASON_QUEUE_PURGE drop reason to the kfree_skb tracepoint.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/20250715120709.3941510-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yue Haibing and committed by
Jakub Kicinski
6c628ed9 47ee43e4

+2 -8
+2 -8
net/ipv6/mcast.c
··· 845 845 846 846 static void mld_clear_query(struct inet6_dev *idev) 847 847 { 848 - struct sk_buff *skb; 849 - 850 848 spin_lock_bh(&idev->mc_query_lock); 851 - while ((skb = __skb_dequeue(&idev->mc_query_queue))) 852 - kfree_skb(skb); 849 + __skb_queue_purge(&idev->mc_query_queue); 853 850 spin_unlock_bh(&idev->mc_query_lock); 854 851 } 855 852 856 853 static void mld_clear_report(struct inet6_dev *idev) 857 854 { 858 - struct sk_buff *skb; 859 - 860 855 spin_lock_bh(&idev->mc_report_lock); 861 - while ((skb = __skb_dequeue(&idev->mc_report_queue))) 862 - kfree_skb(skb); 856 + __skb_queue_purge(&idev->mc_report_queue); 863 857 spin_unlock_bh(&idev->mc_report_lock); 864 858 } 865 859