cfg80211: export multiple MAC addresses in sysfs
[safe/jmp/linux-2.6] / net / wireless / wext-core.c
index a4e5ddc..5e1656b 100644 (file)
@@ -802,7 +802,8 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
        }
 
        /* Generate an event to notify listeners of the change */
-       if ((descr->flags & IW_DESCR_FLAG_EVENT) && err == -EIWCOMMIT) {
+       if ((descr->flags & IW_DESCR_FLAG_EVENT) &&
+           ((err == 0) || (err == -EIWCOMMIT))) {
                union iwreq_data *data = (union iwreq_data *) iwp;
 
                if (descr->flags & IW_DESCR_FLAG_RESTRICT)
@@ -911,8 +912,9 @@ static int wireless_process_ioctl(struct net *net, struct ifreq *ifr,
  */
 static int wext_permission_check(unsigned int cmd)
 {
-       if ((IW_IS_SET(cmd) || cmd == SIOCGIWENCODE || cmd == SIOCGIWENCODEEXT)
-           && !capable(CAP_NET_ADMIN))
+       if ((IW_IS_SET(cmd) || cmd == SIOCGIWENCODE ||
+            cmd == SIOCGIWENCODEEXT) &&
+           !capable(CAP_NET_ADMIN))
                return -EPERM;
 
        return 0;