[NET]: Fix multicast device ioctl checks Upstream commit 61ee6bd487b9cc160e533034eb338f2085dc7922: SIOCADDMULTI/SIOCDELMULTI check whether the driver has a set_multicast_list method to determine whether it supports multicast. Drivers implementing secondary unicast support use set_rx_mode however. Check for both dev->set_multicast_mode and dev->set_rx_mode to determine multicast capabilities. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- commit 4eed9fb2564cf763918b9711558169e06dbfb8d5 tree 1cead411884581aa0b8932edcc399cab9551e556 parent 16c64cac7d9c6a503f49887219c4fe675e7d43d9 author Patrick McHardy Wed, 26 Mar 2008 02:12:11 -0700 committer Patrick McHardy Sun, 13 Apr 2008 08:04:43 +0200 net/core/dev.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 4d44372..82f77ef 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3240,7 +3240,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) return -EOPNOTSUPP; case SIOCADDMULTI: - if (!dev->set_multicast_list || + if ((!dev->set_multicast_list && !dev->set_rx_mode) || ifr->ifr_hwaddr.sa_family != AF_UNSPEC) return -EINVAL; if (!netif_device_present(dev)) @@ -3249,7 +3249,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) dev->addr_len, 1); case SIOCDELMULTI: - if (!dev->set_multicast_list || + if ((!dev->set_multicast_list && !dev->set_rx_mode) || ifr->ifr_hwaddr.sa_family != AF_UNSPEC) return -EINVAL; if (!netif_device_present(dev))