/* Add or remove reception of all multicast frames to a device. While the count in the device remains above zero the interface remains listening to all interfaces. Once it hits zero the device reverts back to normal filtering operation. A negative @inc value is used to drop the counter when releasing a resource needing all multicasts. Return 0 if successful or a negative errno code on error.  */
int dev_set_allmulti(struct net_device *dev, int inc)
/* Add or remove reception of all multicast frames to a device. While the count in the device remains above zero the interface remains listening to all interfaces. Once it hits zero the device reverts back to normal filtering operation. A negative @inc value is used to drop the counter when releasing a resource needing all multicasts. Return 0 if successful or a negative errno code on error.  */
int dev_set_allmulti(struct net_device *dev, int inc)
{
	unsigned short old_flags = dev->flags;
	ASSERT_RTNL();
	dev->flags |= IFF_ALLMULTI;
	dev->allmulti += inc;
	if (dev->allmulti == 0) {
		if (inc < 0)
			dev->flags &= ~IFF_ALLMULTI;
		else {
			dev->allmulti -= inc;
			printk(KERN_WARNING "%s: allmulti touches roof, "
				"set allmulti failed, allmulti feature of "
				"device might be broken.\n", dev->name);
			return -EOVERFLOW;
		}
	}
	if (dev->flags ^ old_flags) {
		dev_change_rx_flags(dev, IFF_ALLMULTI);
		dev_set_rx_mode(dev);
	}
	return 0;
}