mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-29 02:38:22 -05:00
nl80211: Use NL80211_CMD_DEL_STATION event to indicate IBSS peer loss
This commit is contained in:
parent
d47fa330b8
commit
ef985058f4
@ -1289,6 +1289,26 @@ static void nl80211_new_station_event(struct wpa_driver_nl80211_data *drv,
|
||||
}
|
||||
|
||||
|
||||
static void nl80211_del_station_event(struct wpa_driver_nl80211_data *drv,
|
||||
struct nlattr **tb)
|
||||
{
|
||||
u8 *addr;
|
||||
union wpa_event_data data;
|
||||
|
||||
if (tb[NL80211_ATTR_MAC] == NULL)
|
||||
return;
|
||||
addr = nla_data(tb[NL80211_ATTR_MAC]);
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Delete station " MACSTR,
|
||||
MAC2STR(addr));
|
||||
if (drv->nlmode != NL80211_IFTYPE_ADHOC)
|
||||
return;
|
||||
|
||||
os_memset(&data, 0, sizeof(data));
|
||||
os_memcpy(data.ibss_peer_lost.peer, addr, ETH_ALEN);
|
||||
wpa_supplicant_event(drv->ctx, EVENT_IBSS_PEER_LOST, &data);
|
||||
}
|
||||
|
||||
|
||||
static int process_event(struct nl_msg *msg, void *arg)
|
||||
{
|
||||
struct wpa_driver_nl80211_data *drv = arg;
|
||||
@ -1404,6 +1424,9 @@ static int process_event(struct nl_msg *msg, void *arg)
|
||||
case NL80211_CMD_NEW_STATION:
|
||||
nl80211_new_station_event(drv, tb);
|
||||
break;
|
||||
case NL80211_CMD_DEL_STATION:
|
||||
nl80211_del_station_event(drv, tb);
|
||||
break;
|
||||
default:
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Ignored unknown event "
|
||||
"(cmd=%d)", gnlh->cmd);
|
||||
|
Loading…
Reference in New Issue
Block a user