netdev: Handle CMD_DISCONNECT without "by AP" flag

There are situations including after beacon loss and during FT where the
cfg80211 will detect we're now disconnected (in some cases will send a
Deauthenticate frame too) and generate this event, or the driver may do
this.  For example in ieee80211_report_disconnect in net/mac80211/mlme.c
will (through cfg80211) generate a CMD_DEAUTHENTICATE followed by a
CMD_DISCONNECT.
This commit is contained in:
Andrew Zaborowski 2017-08-14 14:31:17 +02:00 committed by Denis Kenzior
parent 5c4313bcc2
commit cb9c6e8ade
1 changed files with 7 additions and 1 deletions

View File

@ -659,9 +659,15 @@ static void netdev_disconnect_event(struct l_genl_msg *msg,
event_data = netdev->user_data;
netdev_connect_free(netdev);
if (disconnect_by_ap && event_filter)
if (!event_filter)
return;
if (disconnect_by_ap)
event_filter(netdev, NETDEV_EVENT_DISCONNECT_BY_AP,
event_data);
else
event_filter(netdev, NETDEV_EVENT_DISCONNECT_BY_SME,
event_data);
}
static void netdev_cmd_disconnect_cb(struct l_genl_msg *msg, void *user_data)