mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-21 03:32:42 +01:00
netdev: Emit DISCONNECT_BY_SME event on eapol failures
There are situations when a CMD_DISCONNECT or deauthenticate will be issued locally because of an error detected locally where netdev would not be able to emit a event to the device object. The CMD_DISCONNECT handler can only send an event if the disconnect is triggered by the AP because we don't have an enum value defined for other diconnects. We have these values defined for the connect callback but those errors may happen when the connect callback is already NULL because a connection has been estabilshed. So add an event type for local errors. These situations may occur in a transition negotiation or in an eapol handshake failure during rekeying resulting in a call to netdev_handshake_failed.
This commit is contained in:
parent
4d366df23f
commit
27bdddf010
@ -615,6 +615,10 @@ static void device_netdev_event(struct netdev *netdev, enum netdev_event event,
|
|||||||
break;
|
break;
|
||||||
case NETDEV_EVENT_DISCONNECT_BY_AP:
|
case NETDEV_EVENT_DISCONNECT_BY_AP:
|
||||||
device_disconnect_by_ap(device);
|
device_disconnect_by_ap(device);
|
||||||
|
break;
|
||||||
|
case NETDEV_EVENT_DISCONNECT_BY_SME:
|
||||||
|
device_disassociated(device);
|
||||||
|
break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,6 +323,7 @@ static void netdev_connect_failed(struct l_genl_msg *msg, void *user_data)
|
|||||||
{
|
{
|
||||||
struct netdev *netdev = user_data;
|
struct netdev *netdev = user_data;
|
||||||
netdev_connect_cb_t connect_cb = netdev->connect_cb;
|
netdev_connect_cb_t connect_cb = netdev->connect_cb;
|
||||||
|
netdev_event_func_t event_filter = netdev->event_filter;
|
||||||
void *connect_data = netdev->user_data;
|
void *connect_data = netdev->user_data;
|
||||||
enum netdev_result result = netdev->result;
|
enum netdev_result result = netdev->result;
|
||||||
|
|
||||||
@ -333,6 +334,9 @@ static void netdev_connect_failed(struct l_genl_msg *msg, void *user_data)
|
|||||||
|
|
||||||
if (connect_cb)
|
if (connect_cb)
|
||||||
connect_cb(netdev, result, connect_data);
|
connect_cb(netdev, result, connect_data);
|
||||||
|
else if (event_filter)
|
||||||
|
event_filter(netdev, NETDEV_EVENT_DISCONNECT_BY_SME,
|
||||||
|
connect_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void netdev_free(void *data)
|
static void netdev_free(void *data)
|
||||||
|
@ -43,6 +43,7 @@ enum netdev_event {
|
|||||||
NETDEV_EVENT_SETTING_KEYS,
|
NETDEV_EVENT_SETTING_KEYS,
|
||||||
NETDEV_EVENT_LOST_BEACON,
|
NETDEV_EVENT_LOST_BEACON,
|
||||||
NETDEV_EVENT_DISCONNECT_BY_AP,
|
NETDEV_EVENT_DISCONNECT_BY_AP,
|
||||||
|
NETDEV_EVENT_DISCONNECT_BY_SME,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum netdev_watch_event {
|
enum netdev_watch_event {
|
||||||
|
Loading…
Reference in New Issue
Block a user