mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
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>
This commit is contained in:
parent
47ee43e4bf
commit
6c628ed95e
|
|
@ -845,21 +845,15 @@ static void mld_clear_delrec(struct inet6_dev *idev)
|
|||
|
||||
static void mld_clear_query(struct inet6_dev *idev)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
|
||||
spin_lock_bh(&idev->mc_query_lock);
|
||||
while ((skb = __skb_dequeue(&idev->mc_query_queue)))
|
||||
kfree_skb(skb);
|
||||
__skb_queue_purge(&idev->mc_query_queue);
|
||||
spin_unlock_bh(&idev->mc_query_lock);
|
||||
}
|
||||
|
||||
static void mld_clear_report(struct inet6_dev *idev)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
|
||||
spin_lock_bh(&idev->mc_report_lock);
|
||||
while ((skb = __skb_dequeue(&idev->mc_report_queue)))
|
||||
kfree_skb(skb);
|
||||
__skb_queue_purge(&idev->mc_report_queue);
|
||||
spin_unlock_bh(&idev->mc_report_lock);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user