99ec0af5eb
IFF_ALLMULTI is set/unset to if_flags via if_mcast_op. To avoid data races on if_flags, IFNET_LOCK was added for if_mcast_op. Unfortunately it produces a deadlock so we want to remove added IFNET_LOCK by avoiding the data races by another approach. This fix introduces ec_flags to struct ethercom and stores IFF_ALLMULTI to it. ec_flags is protected by ETHER_LOCK and thus IFNET_LOCK is no longer necessary for if_mcast_op. Note that the fix is applied only to MP-safe drivers that the data races matter. In the kernel, IFF_ALLMULTI is set by a driver and used by the driver itself. So changing the storing place doesn't break anything. One exception is ioctl(SIOCGIFFLAGS); we have to include IFF_ALLMULTI in a result if needed to export the flag as well as before. A upcoming commit will remove IFNET_LOCK. PR kern/54189