mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
netdev: Fix disconnect event coming out of order
mac80211 drivers seem to send the disconnect event which is triggered by CMD_DISCONNECT prior to the CMD_DISCONNECT response. However, some drivers, namely brcmfmac, send the response first and then send the disconnect event. This confused iwd when a connection was immediately triggered after a disconnection (network switch operation). Fix this by making sure that connected variable isn't set until the connect event is actually processed, and ignore disconnect events which come after CMD_DISCONNECT has alredy succeeded.
This commit is contained in:
parent
df64dd443e
commit
53ea9adfb5
@ -2055,6 +2055,8 @@ static void netdev_cmd_connect_cb(struct l_genl_msg *msg, void *user_data)
|
|||||||
|
|
||||||
/* Wait for connect event */
|
/* Wait for connect event */
|
||||||
if (l_genl_msg_get_error(msg) >= 0) {
|
if (l_genl_msg_get_error(msg) >= 0) {
|
||||||
|
netdev->connected = true;
|
||||||
|
|
||||||
if (netdev->event_filter)
|
if (netdev->event_filter)
|
||||||
netdev->event_filter(netdev,
|
netdev->event_filter(netdev,
|
||||||
NETDEV_EVENT_ASSOCIATING,
|
NETDEV_EVENT_ASSOCIATING,
|
||||||
@ -2397,7 +2399,6 @@ static int netdev_connect_common(struct netdev *netdev,
|
|||||||
netdev->event_filter = event_filter;
|
netdev->event_filter = event_filter;
|
||||||
netdev->connect_cb = cb;
|
netdev->connect_cb = cb;
|
||||||
netdev->user_data = user_data;
|
netdev->user_data = user_data;
|
||||||
netdev->connected = true;
|
|
||||||
netdev->handshake = hs;
|
netdev->handshake = hs;
|
||||||
netdev->sm = sm;
|
netdev->sm = sm;
|
||||||
netdev->frequency = bss->frequency;
|
netdev->frequency = bss->frequency;
|
||||||
@ -2432,7 +2433,7 @@ int netdev_connect(struct netdev *netdev, struct scan_bss *bss,
|
|||||||
netdev->type != NL80211_IFTYPE_P2P_CLIENT)
|
netdev->type != NL80211_IFTYPE_P2P_CLIENT)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
if (netdev->connected)
|
if (netdev->connected || netdev->connect_cmd_id)
|
||||||
return -EISCONN;
|
return -EISCONN;
|
||||||
|
|
||||||
switch (hs->akm_suite) {
|
switch (hs->akm_suite) {
|
||||||
|
Loading…
Reference in New Issue
Block a user