: Fix multicast device ioctl checks
Subsystems (2)
commit 33fb000e9d0b9b20c226383ce775f06fdcd426bc
Author: Patrick McHardy <[email protected]> Date: Tue Mar 25 13:53:52 2008 +0100
[NET]: Fix multicast device ioctl checks
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.
net/core/dev.c +2 -2
@@ -3329,7 +3329,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))
@@ -3338,7 +3338,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))
David Miller
maintainerFrom: Patrick McHardy <[email protected]>
Date: Tue, 25 Mar 2008 13:54:53 +0100
Quoted 6 lines
commit
33fb000e9d0b9b20c226383ce775f06fdcd426bcAuthor: Patrick McHardy <[email protected]> Date: Tue Mar 25 13:53:52 2008 +0100[NET]: Fix multicast device ioctl checks
Quoted 8 lines
SIOCADDMULTI/SIOCDELMULTI check whether the driver has a
set_multicast_listmethod to determine whether it supports multicast. Drivers implementing secondary unicast support useset_rx_modehowever.Check for both
dev->set_multicast_modeanddev->set_rx_modeto determine multicast capabilities.Signed-off-by Patrick McHardy <[email protected]>
Applied and queued up for -stable, thanks!