aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tun.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index d8b1ba15aa6f..0ce07a339c7e 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -741,7 +741,12 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
741 case SIOCADDMULTI: 741 case SIOCADDMULTI:
742 /** Add the specified group to the character device's multicast filter 742 /** Add the specified group to the character device's multicast filter
743 * list. */ 743 * list. */
744 rtnl_lock();
745 netif_tx_lock_bh(tun->dev);
744 add_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data); 746 add_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data);
747 netif_tx_unlock_bh(tun->dev);
748 rtnl_unlock();
749
745 DBG(KERN_DEBUG "%s: add multi: %s\n", 750 DBG(KERN_DEBUG "%s: add multi: %s\n",
746 tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data)); 751 tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data));
747 return 0; 752 return 0;
@@ -749,7 +754,12 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
749 case SIOCDELMULTI: 754 case SIOCDELMULTI:
750 /** Remove the specified group from the character device's multicast 755 /** Remove the specified group from the character device's multicast
751 * filter list. */ 756 * filter list. */
757 rtnl_lock();
758 netif_tx_lock_bh(tun->dev);
752 del_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data); 759 del_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data);
760 netif_tx_unlock_bh(tun->dev);
761 rtnl_unlock();
762
753 DBG(KERN_DEBUG "%s: del multi: %s\n", 763 DBG(KERN_DEBUG "%s: del multi: %s\n",
754 tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data)); 764 tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data));
755 return 0; 765 return 0;