Revert "wifi: virt_wifi: avoid reporting connection success with wrong SSID"
This reverts commit 1c786f1067
.
This commit is contained in:
parent
4f9bfbe9f1
commit
bfbdef95a1
1 changed files with 3 additions and 16 deletions
|
@ -138,8 +138,6 @@ static struct ieee80211_supported_band band_5ghz = {
|
|||
/* Assigned at module init. Guaranteed locally-administered and unicast. */
|
||||
static u8 fake_router_bssid[ETH_ALEN] __ro_after_init = {};
|
||||
|
||||
#define VIRT_WIFI_SSID "VirtWifi"
|
||||
|
||||
static void virt_wifi_inform_bss(struct wiphy *wiphy)
|
||||
{
|
||||
u64 tsf = div_u64(ktime_get_boottime_ns(), 1000);
|
||||
|
@ -150,8 +148,8 @@ static void virt_wifi_inform_bss(struct wiphy *wiphy)
|
|||
u8 ssid[8];
|
||||
} __packed ssid = {
|
||||
.tag = WLAN_EID_SSID,
|
||||
.len = strlen(VIRT_WIFI_SSID),
|
||||
.ssid = VIRT_WIFI_SSID,
|
||||
.len = 8,
|
||||
.ssid = "VirtWifi",
|
||||
};
|
||||
|
||||
informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz,
|
||||
|
@ -226,8 +224,6 @@ struct virt_wifi_netdev_priv {
|
|||
struct net_device *upperdev;
|
||||
u32 tx_packets;
|
||||
u32 tx_failed;
|
||||
u32 connect_requested_ssid_len;
|
||||
u8 connect_requested_ssid[IEEE80211_MAX_SSID_LEN];
|
||||
u8 connect_requested_bss[ETH_ALEN];
|
||||
bool is_up;
|
||||
bool is_connected;
|
||||
|
@ -244,12 +240,6 @@ static int virt_wifi_connect(struct wiphy *wiphy, struct net_device *netdev,
|
|||
if (priv->being_deleted || !priv->is_up)
|
||||
return -EBUSY;
|
||||
|
||||
if (!sme->ssid)
|
||||
return -EINVAL;
|
||||
|
||||
priv->connect_requested_ssid_len = sme->ssid_len;
|
||||
memcpy(priv->connect_requested_ssid, sme->ssid, sme->ssid_len);
|
||||
|
||||
could_schedule = schedule_delayed_work(&priv->connect, HZ * 2);
|
||||
if (!could_schedule)
|
||||
return -EBUSY;
|
||||
|
@ -273,15 +263,12 @@ static void virt_wifi_connect_complete(struct work_struct *work)
|
|||
container_of(work, struct virt_wifi_netdev_priv, connect.work);
|
||||
u8 *requested_bss = priv->connect_requested_bss;
|
||||
bool right_addr = ether_addr_equal(requested_bss, fake_router_bssid);
|
||||
bool right_ssid = priv->connect_requested_ssid_len == strlen(VIRT_WIFI_SSID) &&
|
||||
!memcmp(priv->connect_requested_ssid, VIRT_WIFI_SSID,
|
||||
priv->connect_requested_ssid_len);
|
||||
u16 status = WLAN_STATUS_SUCCESS;
|
||||
|
||||
if (is_zero_ether_addr(requested_bss))
|
||||
requested_bss = NULL;
|
||||
|
||||
if (!priv->is_up || (requested_bss && !right_addr) || !right_ssid)
|
||||
if (!priv->is_up || (requested_bss && !right_addr))
|
||||
status = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
else
|
||||
priv->is_connected = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue