igmp_leave:add check of dev status in igmp_leavegroup

Signed-off-by: wangchen <wangchen41@xiaomi.com>
This commit is contained in:
wangchen 2024-09-03 21:21:00 +08:00 committed by Xiang Xiao
parent 3f1fd42f73
commit 78b64cc220

View file

@ -166,7 +166,7 @@ int igmp_leavegroup(struct net_driver_s *dev,
/* Send a leave if the flag is set according to the state diagram */
if (IS_LASTREPORT(group->flags))
if (IFF_IS_UP(dev->d_flags) && IS_LASTREPORT(group->flags))
{
ninfo("Schedule Leave Group message\n");
IGMP_STATINCR(g_netstats.igmp.leave_sched);