netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [NET]: Fix multicast device ioctl checks
@ 2008-03-25 12:54 Patrick McHardy
  2008-03-26  9:12 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2008-03-25 12:54 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1372 bytes --]

commit 33fb000e9d0b9b20c226383ce775f06fdcd426bc
Author: Patrick McHardy <kaber@trash.net>
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.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/core/dev.c b/net/core/dev.c
index fcdf03c..460e7f9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-26  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-25 12:54 [NET]: Fix multicast device ioctl checks Patrick McHardy
2008-03-26  9:12 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).