net/netdev/netdev_register.c: skip mld_devinit if Nic can not support mld

avoid unnecessary operations

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2025-04-14 14:59:50 +08:00
committed by Xiang Xiao
parent f7526522a1
commit f5741c0ea1
+6 -1
View File
@@ -475,7 +475,12 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
#ifdef CONFIG_NET_MLD
/* Configure the device for MLD support */
mld_devinit(dev);
if ((flags & IFF_MULTICAST) != 0)
{
/* MLD is only supported on multicast capable devices */
mld_devinit(dev);
}
#endif
#ifdef NET_ICMPv6_HAVE_STACK