cfg80211: allow cfg80211_connect_result with bssid == NULL
authorZhu Yi <yi.zhu@intel.com>
Wed, 19 Aug 2009 08:08:22 +0000 (16:08 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Aug 2009 15:36:07 +0000 (11:36 -0400)
In case of connection failure, the bssid info is not a must have.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/core.c
net/wireless/sme.c

index c150071b6f2989a265d9b9f89c524e3903d88e71..154e1e294cb99be7651e1c799298facc9a437e7f 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/debugfs.h>
 #include <linux/notifier.h>
 #include <linux/device.h>
+#include <linux/etherdevice.h>
 #include <linux/rtnetlink.h>
 #include <net/genetlink.h>
 #include <net/cfg80211.h>
@@ -309,7 +310,8 @@ static void cfg80211_process_events(struct wireless_dev *wdev)
                switch (ev->type) {
                case EVENT_CONNECT_RESULT:
                        __cfg80211_connect_result(
-                               wdev->netdev, ev->cr.bssid,
+                               wdev->netdev, is_zero_ether_addr(ev->cr.bssid) ?
+                               NULL : ev->cr.bssid,
                                ev->cr.req_ie, ev->cr.req_ie_len,
                                ev->cr.resp_ie, ev->cr.resp_ie_len,
                                ev->cr.status,
index 9ddc00e3c23928e441bc502f322eb5f59e7533b3..4a8289f9b4f01c3602c205047e1c9deabca85534 100644 (file)
@@ -450,7 +450,8 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
                return;
 
        ev->type = EVENT_CONNECT_RESULT;
-       memcpy(ev->cr.bssid, bssid, ETH_ALEN);
+       if (bssid)
+               memcpy(ev->cr.bssid, bssid, ETH_ALEN);
        ev->cr.req_ie = ((u8 *)ev) + sizeof(*ev);
        ev->cr.req_ie_len = req_ie_len;
        memcpy((void *)ev->cr.req_ie, req_ie, req_ie_len);