From 3d9cbdb6f6cf19541657ac1bcacc12a30a2f3b89 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Sat, 30 Sep 2017 04:28:08 +0200 Subject: [PATCH] ap: Drop two unneeded DEL_KEY commands DEL_KEY is not needed and will return errors right after NEW_STATION or right after DEL_STATION. In both cases the kernel makes sure there are no old keys for the station already. --- src/ap.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/ap.c b/src/ap.c index 27bda08e..d94afb15 100644 --- a/src/ap.c +++ b/src/ap.c @@ -656,7 +656,6 @@ static void ap_associate_sta(struct ap_state *ap, struct sta_state *sta) .set = (1 << NL80211_STA_FLAG_AUTHENTICATED) | (1 << NL80211_STA_FLAG_ASSOCIATED), }; - uint8_t key_id = 0; uint8_t rates[256]; uint32_t r, minr, maxr, count = 0; uint16_t capability = l_get_le16(&sta->capability); @@ -688,23 +687,12 @@ static void ap_associate_sta(struct ap_state *ap, struct sta_state *sta) l_genl_msg_unref(msg); l_error("Issuing NEW_STATION failed"); } - - msg = l_genl_msg_new_sized(NL80211_CMD_DEL_KEY, 64); - l_genl_msg_append_attr(msg, NL80211_ATTR_IFINDEX, 4, &ifindex); - l_genl_msg_append_attr(msg, NL80211_ATTR_KEY_IDX, 1, &key_id); - l_genl_msg_append_attr(msg, NL80211_ATTR_MAC, 6, sta->addr); - - if (!l_genl_family_send(nl80211, msg, ap_del_key_cb, NULL, NULL)) { - l_genl_msg_unref(msg); - l_error("Issuing DEL_KEY failed"); - } } static void ap_disassociate_sta(struct ap_state *ap, struct sta_state *sta) { struct l_genl_msg *msg; uint32_t ifindex = device_get_ifindex(ap->device); - uint8_t key_id = 0; sta->associated = false; sta->rsna = false; @@ -718,16 +706,6 @@ static void ap_disassociate_sta(struct ap_state *ap, struct sta_state *sta) l_genl_msg_unref(msg); l_error("Issuing DEL_STATION failed"); } - - msg = l_genl_msg_new_sized(NL80211_CMD_DEL_KEY, 64); - l_genl_msg_append_attr(msg, NL80211_ATTR_IFINDEX, 4, &ifindex); - l_genl_msg_append_attr(msg, NL80211_ATTR_KEY_IDX, 1, &key_id); - l_genl_msg_append_attr(msg, NL80211_ATTR_MAC, 6, sta->addr); - - if (!l_genl_family_send(nl80211, msg, ap_del_key_cb, NULL, NULL)) { - l_genl_msg_unref(msg); - l_error("Issuing DEL_KEY failed"); - } } static bool ap_common_rates(struct l_uintset *ap_rates,