Hi! I have the same problem with wpasuplicant and ndiswrapper. Renice often works, but not every time and it is uncomfortable with Networkmanager. So I searched in the source.
My conclusion: After the last handshake packet from the access point has arrived, the computer sends its last packet and than sets the wpa key. But at this time sending of the last handshake packet is still in progress and setting the key disturbs this process. Inserting a pause between this two actions solves the problem.
Hi! I have the same problem with wpasuplicant and ndiswrapper. Renice often works, but not every time and it is uncomfortable with Networkmanager. So I searched in the source.
My conclusion: After the last handshake packet from the access point has arrived, the computer sends its last packet and than sets the wpa key. But at this time sending of the last handshake packet is still in progress and setting the key disturbs this process. Inserting a pause between this two actions solves the problem.
wpa.c:
void wpa_supplicant_ process_ 3_of_4( ..) t_send_ 4_of_4( ) key_send( ) t_install_ ptk() wext_set_ key()
{
.
.
wpa_supplican
-> wpa_eapol_
-> wpa_sm_ether_send()
-> wpa_ether_send()
-> l2_packet_send()
-> sendto()
.
.
usleep(10);
.
.
wpa_supplican
-> wpa_sm_set_key()
-> wpa_driver_
-> ioctl()
.
.
}