nl80211: Use NL80211_CMD_DEL_STATION event to indicate IBSS peer loss
This commit is contained in:
parent
d47fa330b8
commit
ef985058f4
1 changed files with 23 additions and 0 deletions
|
@ -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)
|
static int process_event(struct nl_msg *msg, void *arg)
|
||||||
{
|
{
|
||||||
struct wpa_driver_nl80211_data *drv = 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:
|
case NL80211_CMD_NEW_STATION:
|
||||||
nl80211_new_station_event(drv, tb);
|
nl80211_new_station_event(drv, tb);
|
||||||
break;
|
break;
|
||||||
|
case NL80211_CMD_DEL_STATION:
|
||||||
|
nl80211_del_station_event(drv, tb);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Ignored unknown event "
|
wpa_printf(MSG_DEBUG, "nl80211: Ignored unknown event "
|
||||||
"(cmd=%d)", gnlh->cmd);
|
"(cmd=%d)", gnlh->cmd);
|
||||||
|
|
Loading…
Reference in a new issue