netdev: parse michael MIC failure message

This event indicates a security issue. The proper handling would be
to rekey but for now at least provide some information to the user.
This commit is contained in:
James Prestwood 2022-11-01 13:17:46 -07:00 committed by Denis Kenzior
parent 9f1fa53aae
commit d4da6b5bec
1 changed files with 17 additions and 0 deletions

View File

@ -5174,6 +5174,20 @@ static void netdev_channel_switch_event(struct l_genl_msg *msg,
&netdev->frequency, netdev->user_data);
}
static void netdev_michael_mic_failure(struct l_genl_msg *msg,
struct netdev *netdev)
{
uint8_t idx;
uint32_t type;
if (nl80211_parse_attrs(msg, NL80211_ATTR_KEY_IDX, &idx,
NL80211_ATTR_KEY_TYPE, &type,
NL80211_ATTR_UNSPEC) < 0)
return;
l_debug("ifindex=%u key_idx=%u type=%u", netdev->index, idx, type);
}
static void netdev_mlme_notify(struct l_genl_msg *msg, void *user_data)
{
struct netdev *netdev = NULL;
@ -5224,6 +5238,9 @@ static void netdev_mlme_notify(struct l_genl_msg *msg, void *user_data)
case NL80211_CMD_DEL_STATION:
netdev_station_event(msg, netdev, false);
break;
case NL80211_CMD_MICHAEL_MIC_FAILURE:
netdev_michael_mic_failure(msg, netdev);
break;
}
}