]> err.no Git - linux-2.6/blobdiff - drivers/net/tun.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[linux-2.6] / drivers / net / tun.c
index d8b1ba15aa6f6d9060f74c9ad2182eccc63c99c4..0ce07a339c7eee77a209fc365e664976ed4a6b57 100644 (file)
@@ -741,7 +741,12 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
        case SIOCADDMULTI:
                /** Add the specified group to the character device's multicast filter
                 * list. */
+               rtnl_lock();
+               netif_tx_lock_bh(tun->dev);
                add_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data);
+               netif_tx_unlock_bh(tun->dev);
+               rtnl_unlock();
+
                DBG(KERN_DEBUG "%s: add multi: %s\n",
                    tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data));
                return 0;
@@ -749,7 +754,12 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
        case SIOCDELMULTI:
                /** Remove the specified group from the character device's multicast
                 * filter list. */
+               rtnl_lock();
+               netif_tx_lock_bh(tun->dev);
                del_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data);
+               netif_tx_unlock_bh(tun->dev);
+               rtnl_unlock();
+
                DBG(KERN_DEBUG "%s: del multi: %s\n",
                    tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data));
                return 0;